You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Importing any oracle from aalpy.oracles will result in a circular import on version 1.1.7 which is the newest version from pypi. This issue also exists on the most current commit: a59df07
Minimum working example:
fromaalpy.oraclesimportWMethodEqOracle
Resulting in:
Traceback (most recent call last):
File "test.py", line 1, in <module>
from aalpy.oracles import UserInputEqOracle
File "USER/.virtualenvs/avlstar4/lib/python3.8/site-packages/aalpy/oracles/__init__.py", line 9, in <module>
from .UserInputEqOracle import UserInputEqOracle
File "USER/.virtualenvs/avlstar4/lib/python3.8/site-packages/aalpy/oracles/UserInputEqOracle.py", line 2, in <module>
from aalpy.utils import visualize_automaton
File "USER/.virtualenvs/avlstar4/lib/python3.8/site-packages/aalpy/utils/__init__.py", line 4, in <module>
from .ModelChecking import model_check_experiment, mdp_2_prism_format, model_check_properties, get_properties_file, get_correct_prop_values, compare_automata
File "USER/.virtualenvs/avlstar4/lib/python3.8/site-packages/aalpy/utils/ModelChecking.py", line 9, in <module>
from aalpy.oracles import RandomWMethodEqOracle
ImportError: cannot import name 'RandomWMethodEqOracle' from partially initialized module 'aalpy.oracles' (most likely due to a circular import) (USER/.virtualenvs/avlstar4/lib/python3.8/site-packages/aalpy/oracles/__init__.py)
Explanation:
Basically, the init.py of oracles loads the UserInputEqOracle, which in turn requires visualize_automata, in the process initializing init.py of utils which loads ModelChecking which requires the RandomWMethodEqOracle from the partially initialized init.py of oracles.
Notes:
Running tests automatically would probably prevent such easy errors from getting pushed to pypi. I would recommend a tool like pre-commit, if you would like, I could set up a basic configuration for AALpy.
Please tag the versions which are pushed to pypi also here. This would have allowed me to easily find the commit that resulted in this issue.
I switched to version *1.1 for now which does not have this problem.
The text was updated successfully, but these errors were encountered:
Problem:
Importing any oracle from
aalpy.oracles
will result in a circular import on version 1.1.7 which is the newest version from pypi. This issue also exists on the most current commit: a59df07Minimum working example:
Resulting in:
Explanation:
Basically, the init.py of oracles loads the UserInputEqOracle, which in turn requires visualize_automata, in the process initializing init.py of utils which loads ModelChecking which requires the RandomWMethodEqOracle from the partially initialized init.py of oracles.
Notes:
pre-commit
, if you would like, I could set up a basic configuration for AALpy.The text was updated successfully, but these errors were encountered: