Skip to content

Commit

Permalink
Added replace functionality to subnode creation
Browse files Browse the repository at this point in the history
  • Loading branch information
lamsoa729 committed May 18, 2024
1 parent 27a39d7 commit 5be720f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chi_pet/chi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def execute(self):

if self.opts.command == 'create':
chi_root_node = ChiNode(self.opts.workdir, opts=self.opts)
chi_root_node.make_subnodes()
chi_root_node.make_subnodes(replace=self.opts.replace)

elif self.opts.command == 'run':
c = ChiRun(self.opts)
Expand Down
4 changes: 4 additions & 0 deletions chi_pet/chi_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def set_obj_ref(self, obj_r):
self._obj_r = obj_r

def get_number_of_values(self):
if self._values is None:
self.gen_param_values()
return len(self._values)

def gen_param_values(self):
Expand All @@ -130,6 +132,8 @@ def get_value(self):
return self._obj_r.get_value()

def get_dir_str(self):
if self._format_str is None:
self._format_str = self._name + '{}'
return self._format_str.format(self.get_value())

def __str__(self):
Expand Down

0 comments on commit 5be720f

Please sign in to comment.