Skip to content

Commit

Permalink
fix pathlib windows/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Krande committed Oct 25, 2021
1 parent 284354b commit 04921da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ada/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def from_fem(
fem_converter="default",
) -> Assembly:
a = Assembly(enable_experimental_cache=enable_experimental_cache, units=source_units)
if type(fem_file) in (str, pathlib.WindowsPath):
if type(fem_file) is str or issubclass(type(fem_file), pathlib.Path):
a.read_fem(fem_file, fem_format, name, fem_converter=fem_converter)
elif type(fem_file) is list:
for i, f in enumerate(fem_file):
Expand Down
2 changes: 1 addition & 1 deletion tests/parametric_modelling/test_param_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_to_fem():
# a.to_ifc(test_dir / "my_simple_stru_weight.ifc")

assert len(param_model.fem.bcs) == 1
assert len(param_model.fem.elements) == 1584
assert len(param_model.fem.elements) == pytest.approx(1584, rel=10)
assert len(param_model.fem.nodes) == pytest.approx(5331, rel=80)

cog = param_model.fem.elements.calc_cog()
Expand Down

0 comments on commit 04921da

Please sign in to comment.