Skip to content

Commit

Permalink
add exclude parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
benmalef committed Feb 10, 2025
1 parent 60aa3d5 commit 6443161
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions GANDLF/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


from GANDLF.Configuration.Parameters.parameters import Parameters
from GANDLF.Configuration.Parameters.exclude_parameters import exclude_parameters


def _parseConfig(
Expand Down Expand Up @@ -41,9 +42,16 @@ def ConfigManager(
dict: The parameter dictionary.
"""
try:
parameters = Parameters(
parameters_config = Parameters(
**_parseConfig(config_file_path, version_check_flag)
).model_dump(exclude_none=True)
)
parameters = parameters_config.model_dump(
exclude={
field
for field in exclude_parameters
if getattr(parameters_config, field) is None
}
)
return parameters
# except Exception as e:
# ## todo: ensure logging captures assertion errors
Expand Down

0 comments on commit 6443161

Please sign in to comment.