Skip to content

Commit

Permalink
Merge branch 'config_yaml' of github.com:C2SM/processing-chain into c…
Browse files Browse the repository at this point in the history
…onfig_yaml
  • Loading branch information
mjaehn committed Sep 20, 2023
2 parents 5abc77b + d9c30eb commit b969d6c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions run_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def parse_arguments():

return args


class Config():

def __init__(self, casename):
# Global attributes (initialized with default values)
self.casename = casename
Expand All @@ -102,7 +104,6 @@ def __init__(self, casename):
self.set_account()
self.set_node_info()


def load_config_file(self, casename):
"""
Load the configuration settings from a YAML file.
Expand Down Expand Up @@ -143,7 +144,7 @@ def load_config_file(self, casename):
for key, value in cfg_data.items():
setattr(self, key, value)

# Save the user-defined items
# Save the user-defined items
self.user_config = cfg_data.items()

return self
Expand Down Expand Up @@ -172,12 +173,12 @@ def set_node_info(self):
self.ntasks_per_node = 36
self.mpich_cuda = ''
else:
raise ValueError("Invalid value for 'constraint' in the configuration."
"It should be either 'gpu' or 'mc'.")
raise ValueError(
"Invalid value for 'constraint' in the configuration."
"It should be either 'gpu' or 'mc'.")

return self


def print_config(self):
# Print the configuration
max_col_width = max(len(key) for key in vars(self)) + 1
Expand Down

0 comments on commit b969d6c

Please sign in to comment.