Skip to content

Commit

Permalink
bug: Resolve incorrect component use in test & rename variable. (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
MRVermeulenDeltares committed Apr 17, 2024
1 parent e297865 commit 689d592
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions hydrolib/core/dimr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def __init__(self, **data):
process_input = data.get('process', None)
self.process = self._set_process_correctly(process_input)

def _set_process_correctly(self, data):
if not data or data == 0:
def _set_process_correctly(self, process_input):
if not process_input or process_input == 0:
return None
return ' '.join(str(i) for i in range(data))
return ' '.join(str(i) for i in range(process_input))

@classmethod
def get_model(cls):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def test_model_diskonlyfilemodel_field_is_constructed_correctly(
],
)
def test_dimr_with_fmcomponent_saving_process(tmp_path, input_process : int, expected_process_format : str):
component = RRComponent(name="test", workingDir='.', inputfile='test.mdu', process=input_process, mpiCommunicator="DFM_COMM_DFMWORLD")
component = FMComponent(name="test", workingDir='.', inputfile='test.mdu', process=input_process, mpiCommunicator="DFM_COMM_DFMWORLD")
dimr = DIMR(component=component)
save_location : Path = tmp_path/'dimr_config.xml'
dimr.save(filepath=save_location)
Expand Down

0 comments on commit 689d592

Please sign in to comment.