Skip to content

Commit

Permalink
🐛 fix: use new rust modules in python code
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPraet committed Jul 31, 2023
1 parent dbc7fd6 commit 260b956
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tsdownsample/downsampling_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ def mod_single_core(self) -> ModuleType:
If SIMD compiled module is available, that one is returned. Otherwise, the
scalar compiled module is returned.
"""
if hasattr(self.rust_mod, "simd"):
# use SIMD implementation if available
return self.rust_mod.simd
return self.rust_mod.scalar
return self.rust_mod.sequential

@property
def mod_multi_core(self) -> Union[ModuleType, None]:
Expand All @@ -177,12 +174,9 @@ def mod_multi_core(self) -> Union[ModuleType, None]:
Otherwise, the scalar parallel compiled module is returned.
If no parallel compiled module is available, None is returned.
"""
if hasattr(self.rust_mod, "simd_parallel"):
if hasattr(self.rust_mod, "parallel"):
# use SIMD implementation if available
return self.rust_mod.simd_parallel
elif hasattr(self.rust_mod, "scalar_parallel"):
# use scalar implementation if available (when no SIMD available)
return self.rust_mod.scalar_parallel
return self.rust_mod.parallel
return None # no parallel compiled module available

@staticmethod
Expand Down

0 comments on commit 260b956

Please sign in to comment.