cfs-energy / cfspopcon

POPCONs (Plasma OPerating CONtours)
https://cfspopcon.readthedocs.io/en/latest/
MIT License
22 stars 14 forks source link

For ADAS access, error in import cfspopcon #5

Closed AudreySaltzman closed 11 months ago

AudreySaltzman commented 11 months ago

import cfspopcon /home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py(182)_for_cache_name() -> yield from super()._for_cache_name() (Pdb) c /home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py(182)_for_cache_name() -> yield from super()._for_cache_name() (Pdb) c Traceback (most recent call last): File "", line 1, in File "/home/audreysa/cfspopcon/cfspopcon/init.py", line 7, in from . import algorithms, file_io, formulas, helpers, named_options, unit_handling File "/home/audreysa/cfspopcon/cfspopcon/algorithms/init.py", line 5, in from .algorithm_class import Algorithm, CompositeAlgorithm File "/home/audreysa/cfspopcon/cfspopcon/algorithms/algorithm_class.py", line 12, in from ..unit_handling import convert_to_default_units File "/home/audreysa/cfspopcon/cfspopcon/unit_handling/init.py", line 7, in from .decorator import wraps_ufunc File "/home/audreysa/cfspopcon/cfspopcon/unit_handling/decorator.py", line 12, in from .setup_unit_handling import Quantity, convert_units, magnitude, ureg File "/home/audreysa/cfspopcon/cfspopcon/unit_handling/setup_unit_handling.py", line 16, in pint.UnitRegistry( File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/facets/plain/registry.py", line 138, in call obj._after_init() File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/facets/system/registry.py", line 78, in _after_init super()._after_init() File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/facets/group/registry.py", line 64, in _after_init super()._after_init() File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/facets/plain/registry.py", line 307, in _after_init loaded_files = self.load_definitions(path, True) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/facets/plain/registry.py", line 550, in load_definitions parsed_project = self._def_parser.parse_file(file) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/delegates/txt_defparser/defparser.py", line 137, in parse_file return fp.parse( File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexparser.py", line 1401, in parse pp[(source_location, target)] = parsed = parser.parse( File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexparser.py", line 1010, in parse return self.parse_file(source_location) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/delegates/txt_defparser/defparser.py", line 78, in parse_file content, basename = self._diskcache.load(path, super().parse_file) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py", line 336, in load cache_path = self.cache_path_for(header) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py", line 298, in cache_path_for h = self.cache_stem_for(header) File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py", line 288, in cache_stem_for for value in header.for_cache_name(): File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py", line 81, in for_cache_name for el in self._for_cache_name(): File "/home/audreysa/cfspopcon/.venv/lib/python3.9/site-packages/pint/_vendor/flexcache.py", line 182, in _for_cache_name yield from super()._for_cache_name() File "/usr/lib/python3.9/pathlib.py", line 1249, in read_bytes with self.open(mode='rb') as f: File "/usr/lib/python3.9/pathlib.py", line 1242, in open return io.open(self, mode, buffering, encoding, errors, newline, File "/usr/lib/python3.9/pathlib.py", line 1110, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: '/home/audreysa/.cache/pypoetry/virtualenvs/cfspopcon-ecNu8Maz-py3.9/lib/python3.9/site-packages/pint/default_en.txt/constants_en.txt'

AudreySaltzman commented 11 months ago

Fixed by

rm .cache/pint
hassec commented 11 months ago

Similar error was reported in https://github.com/hgrecco/pint/issues/1572. As @AudreySaltzman mentioned, removing the cache should resolve the issue.

I'll close this as solved, but feel free to reopen if new problems come up.