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
activitysim run -c configs -o output -d data gives the following:
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:activitysim.core.config.log_file_path'
in "configs\logging.yaml", line 43, column 17
Lib\site-packages\activitysim\core\workflow\logging.py", line 96, in config_logger
config_dict = yaml.load(f, Loader=yaml.SafeLoader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Working hypothesis
My guess for why this is happening is because at some point activitysim switched to using yaml.SafeLoader at some point, and the config tag !!python/object/apply doesn't work with yaml.SafeLoder.
The most reasonable ChatGPT suggestion states:
Add a Custom Constructor in the Code
Update the YAML loader in the activitysim\core\workflow\logging.py file to handle the !!python/object/apply tag.
Here's how to define and register a custom constructor:
import yaml
from activitysim.core.config import log_file_path
# Define a constructor for the custom tag
def log_file_path_constructor(loader, node):
args = loader.construct_sequence(node) # Extract the arguments
return log_file_path(*args)
# Register the constructor for the specific tag
yaml.add_constructor(
'tag:yaml.org,2002:python/object/apply:activitysim.core.config.log_file_path',
log_file_path_constructor
)
Place this code in the activitysim\core\workflow\logging.py file before the yaml.load call.
But I don't know enough to act on this.
The text was updated successfully, but these errors were encountered:
When running activitysim 1.3.1 (installed using the Hacky solution documented in #919), test_prototype_mtc does NOT run, throwing a yaml syntax error.
To Reproduce
mamba create -n asim activitysim=1.3.1 multimethod=1.9 -c conda-forge --override-channels
(see activitysim 1.3.1 on conda-forge also requires multimethod=1.9 #919 for why multimethod=1.9 is required)activitysim run -c configs -o output -d data
gives the following:Additional Context
The config line in question is
!!python/object/apply:activitysim.core.config.log_file_path ['activitysim.log']
The relevant tracer line being (I think):
Working hypothesis
My guess for why this is happening is because at some point activitysim switched to using
yaml.SafeLoader
at some point, and the config tag!!python/object/apply
doesn't work withyaml.SafeLoder
.The most reasonable ChatGPT suggestion states:
But I don't know enough to act on this.
The text was updated successfully, but these errors were encountered: