Skip to content

Commit

Permalink
Merge pull request #51 from SINTEF/pyctp_error
Browse files Browse the repository at this point in the history
Moved map_platform_specifics.py to pycThermopack folder to avoid import error before platform_specifics.py are generated
  • Loading branch information
Morten Hammer authored Jun 8, 2022
2 parents d4bed55 + caa092d commit 63c0dc8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions addon/pycThermopack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pyctp folder.

Make sure the symbol mapping is correct for the python interface
```bash
cd addon/pycThermopack/pyctp
cd addon/pycThermopack
python map_platform_specifics.py
```

Expand All @@ -88,7 +88,7 @@ pacman -S mingw-w64-x86_64-python
pacman -S mingw-w64-x86_64-python-numpy
pacman -S mingw-w64-x86_64-python-matplotlib
cp bin/dynamic/libthermopack_optim_gfortran_MSYS.so addon/pycThermopack/pyctp/thermopack.dll
cd addon/pycThermopack/pyctp
cd addon/pycThermopack
python map_platform_specifics.py
cd ../../pyExamples
python cpa.py
Expand Down
2 changes: 1 addition & 1 deletion addon/pycThermopack/makescript.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import shutil
import sys
from pathlib import Path
from pyctp import map_platform_specifics
import map_platform_specifics

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_platform_specifics_by_trial_and_error():

dynlibs = ["libthermopack.so", "thermopack.dll", "libthermopack.dynlib"]
for lib in dynlibs:
dyn_lib_path = path.join(path.dirname(__file__), lib)
dyn_lib_path = path.join(path.dirname(__file__), "pyctp", lib)
try:
tp = cdll.LoadLibrary(dyn_lib_path)
except OSError:
Expand Down Expand Up @@ -152,6 +152,6 @@ def write_platform_specifics_file(pf_specifics, filename):

if __name__ == "__main__":
pf_specifics_path = os.path.join(os.path.dirname(
__file__), "platform_specifics.py")
__file__), "pyctp", "platform_specifics.py")
pf_specifics = get_platform_specifics_by_trial_and_error()
write_platform_specifics_file(pf_specifics, pf_specifics_path)
4 changes: 1 addition & 3 deletions addon/pycThermopack/pyctp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Initialization code for the pyctp package"""
from . import map_platform_specifics
from . import platform_specifics
from . import thermo
from . import cubic
Expand All @@ -16,8 +15,7 @@
from . import pets
from . import lee_kesler

__all__ = ["map_platform_specifics",
"platform_specifics",
__all__ = ["platform_specifics",
"thermo",
"cubic",
"tcPR",
Expand Down

0 comments on commit 63c0dc8

Please sign in to comment.