Skip to content

Commit

Permalink
using github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liubenyuan committed Oct 22, 2020
1 parent e1b3d7f commit 3681f51
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
12 changes: 12 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: pyeit-environment
channels:
- defaults
- conda-forge
dependencies:
- pylint
- pytest
- numpy
- scipy
- pandas
- matplotlib
- vispy
3 changes: 2 additions & 1 deletion examples/eit_dynamic_jac3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

""" 3. JAC solver """
# number of stimulation lines/patterns
eit = jac.JAC(mesh_obj, el_pos, ex_mat=ex_mat, step=step, perm=1., parser='std')
eit = jac.JAC(mesh_obj, el_pos, ex_mat=ex_mat, step=step, perm=1.,
parser='std')
eit.setup(p=0.50, lamb=1e-3, method='kotre')
ds = eit.solve(f1.v, f0.v, normalize=False)
node_ds = sim2pts(pts, tri, np.real(ds))
Expand Down
6 changes: 3 additions & 3 deletions pyeit/io/daeger_eit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def read_header(fname, max_lines=50):
cell = line.split(':')
fmt = int(cell[1])
# failed to find valid parameters
if fr==0:
if fr == 0:
print('Frame rate could not be read, setting to 20')
fr = 20
if fmt==0:
if fmt == 0:
print('Format could not be read, setting to 51')
fmt = 51

Expand Down Expand Up @@ -119,7 +119,7 @@ def to_df(self):
raise NotImplementedError()


if __name__=="__main__":
if __name__ == "__main__":
file_name = r"./ID_SC_10_001.eit"
model = DAEGER_EIT(fname=file_name)
print(model.info)
Expand Down
10 changes: 5 additions & 5 deletions pyeit/io/et3.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ def to_dp(self, resample=None, rel_date=None, fps=1, aux_filter=False):
if aux_filter:
# filter auxillary sampled data
# correct temperature (temperature cannot be 0)
dp.loc[dp['tleft']==0, 'tleft'] = np.nan
dp.loc[dp['tright']==0, 'tright'] = np.nan
dp.loc[dp['nt_s']==0, 'nt_s'] = np.nan
dp.loc[dp['rt_s']==0, 'rt_s'] = np.nan
dp.loc[dp['tleft'] == 0, 'tleft'] = np.nan
dp.loc[dp['tright'] == 0, 'tright'] = np.nan
dp.loc[dp['nt_s'] == 0, 'nt_s'] = np.nan
dp.loc[dp['rt_s'] == 0, 'rt_s'] = np.nan

dp.tleft = med_outlier(dp.tleft)
dp.tright = med_outlier(dp.tright)
Expand All @@ -240,7 +240,7 @@ def med_outlier(d, window=17):
""" filter outliers using median filter """
med = d.rolling(window, center=False).median()
std = d.rolling(window, center=False).std()
std[std==np.nan] = 0.0
std[std == np.nan] = 0.0
# replace med with d for outlier removal
df = med[(d <= med+3*std) & (d >= med-3*std)]
return df
Expand Down
2 changes: 1 addition & 1 deletion pyeit/mesh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def edge_grad(p, fd, h0=1.0):
d_eps = 1e-8 * h0

# get dimensions
if np.ndim(p)==1:
if np.ndim(p) == 1:
p = p[:, np.newaxis]

# distance
Expand Down
1 change: 0 additions & 1 deletion tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ def test_multiplication():

def test_floating_addition():
assert_allclose(0.1 + 0.2, 0.3)

0 comments on commit 3681f51

Please sign in to comment.