Closed rburghol closed 1 year ago
Had a similar goof up when refactoring specl to include OM: NameError: name 'set_state' is not defined
set_state()
was defined in state.py
and referenced in om.py
(and other places), but I had the bright idea that I should probably import om.py
into state.py
at the top of the file, when in reality om.py
needed to be imported after all functions that it relied on from state.py
.
This one was tricky. It only occurred after I split
utilities_specl
intoom
andstate
,.om.py
andom_model_object.py
: model object depends on helper functions from om lib, but the om lib also loads objects and run-time code from model object, thus positioning of import statements in the code are important.model_path_loader(model_object_cache)
, as this triggered a handful of calls tois_float_digit()
from within the model object handler classes.is_float_digit()
was defined inom.py
is_float_digit()
was defined inom
, andom
was imported by every handler class code.import
calls forom
class files to after the is_float_digit()` function is defined.utilities_specl.py
file.om
handler classes were imported intoom.py
prior to the creation of theis_float_digit()
function, those classes were already loaded, meaning that they would find nothing when looking for this function.om
help functions likeis_float_digit()
should be instate.py
or a separate file?state.py
andom.py
state.py
,om.py
used functions fromstate.py
state.py
didn't need functions fromom.py