MPh-py / MPh

Pythonic scripting interface for Comsol Multiphysics
https://mph.readthedocs.io
MIT License
263 stars 67 forks source link

`model.save()` can fail with current `master` #32

Closed max3-2 closed 3 years ago

max3-2 commented 3 years ago

John,

currently model save can fail if the argument is a single string, e.g. model.save('test.mph') - this occurs due to

        # Possibly deduce format from file ending.
        if format is None:
            suffix = path.suffix if path else '.mph'

where path is str and thus has no suffix. I think either a clear specification that a pathlib.Path needs to be supplied (complicated) or a typecast in model.save() is needed.

Best

john-hen commented 3 years ago

That was an oversight in the latest commits, thanks for reporting. I'll fix that before the next release. We just need to coerce str to Path just like before.