Skip to content

Commit 250bf6a

Browse files
committed
removing an unnecessary mutex
1 parent 38be163 commit 250bf6a

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/silvimetric/commands/shatter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def kill_gracefully(signum, frame):
213213
end_time = datetime.datetime.now().timestamp() * 1000
214214
config.end_time = end_time
215215
config.finished = True
216+
point_count = config.point_count
216217
else:
217218
# Handle non-distributed dask scenarios
218219
with ProgressBar():

src/silvimetric/resources/metric.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -158,30 +158,29 @@ def sanitize_and_run(self, d, locs, args):
158158
attrs = [a.entry_name(attr) for a in self.dependencies]
159159

160160
if isinstance(args, pd.DataFrame):
161-
with mutex:
162-
idx = locs.loc[d.index[0]]
163-
xi = idx.xi
164-
yi = idx.yi
165-
pass_args = []
166-
for a in attrs:
167-
try:
168-
arg = args.at[(yi, xi), a]
169-
if isinstance(arg, list) or isinstance(arg, tuple):
170-
pass_args.append(arg)
171-
elif np.isnan(arg):
172-
return self.nan_value
173-
else:
174-
pass_args.append(arg)
175-
176-
except Exception as e:
177-
if self.nan_policy == 'propagate':
178-
return self.nan_value
179-
else:
180-
raise (e)
161+
idx = locs.loc[d.index[0]]
162+
xi = idx.xi
163+
yi = idx.yi
164+
pass_args = []
165+
for a in attrs:
166+
try:
167+
arg = args.at[(yi, xi), a]
168+
if isinstance(arg, (list, tuple)):
169+
pass_args.append(arg)
170+
elif np.isnan(arg):
171+
return self.nan_value
172+
else:
173+
pass_args.append(arg)
174+
175+
except Exception as e:
176+
if self.nan_policy == 'propagate':
177+
return self.nan_value
178+
else:
179+
raise (e)
181180
else:
182181
pass_args = args
183-
184-
return self._method(d, *pass_args)
182+
a = self._method(d, *pass_args)
183+
return a
185184

186185
def do(self, data: pd.DataFrame, *args) -> pd.DataFrame:
187186
"""Run metric and filters. Use previously run metrics to avoid running

0 commit comments

Comments
 (0)