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
Currently, parameters defined high up in the inheritance hierarchy will show up in .settings files for tasks they aren't used in. For instance, www is often defined in [default] but [ts] doesn't actually use www. This isn't a huge problem but it can confuse users and developers.
The text was updated successfully, but these errors were encountered:
Started looking into this as part of #204, but it is a bit tedious.
In zppy/utils.py:
# -----------------------------------------------------------------------------
# Condense directory to only have necessary settings
# To find all used parameters, run:
# `git grep "c\[" zppy/<task.py` and `git grep "{{" zppy/templates/<task>.bash`
def condense_settings(settings_dict, used_parameters):
keys = list(settings_dict.keys())
used_parameters = set(used_parameters)
slurm_header_parameters = ["nodes", "partition", "prefix", "qos", "scriptDir", "walltime"]
used_parameters = used_parameters.union(slurm_header_parameters)
for key in keys:
if key not in used_parameters:
settings_dict.pop(key)
return settings_dict
In zppy/tc_analysis.py, for instance, the following would be added
# Create script
with open(scriptFile, "w") as f:
f.write(template.render(**c))
with open(settingsFile, "w") as sf:
p = pprint.PrettyPrinter(indent=2, stream=sf)
p.pprint(c)
p.pprint(s)
Would also need to account for parameters in zppy/__main__.py.
Currently, parameters defined high up in the inheritance hierarchy will show up in
.settings
files for tasks they aren't used in. For instance,www
is often defined in[default]
but[ts]
doesn't actually usewww
. This isn't a huge problem but it can confuse users and developers.The text was updated successfully, but these errors were encountered: