Skip to content

Commit

Permalink
General bugfixes from application testing (#689)
Browse files Browse the repository at this point in the history
* Bugfix! Program errors out if no valid jobs are found

* Bugfix! Validation of JETTO namelist names should be uppercase

* Bugfix! JETTO setup routine has special keys which do not follow standard access in jetto_tools

* Bugfix! jetto_tools no longer returns ndarrays, affects copyto operator

* Abort when jobs are empty

* Update src/duqtools/systems/jetto/_system.py

* Update src/duqtools/schema/_dimensions.py

* Update src/duqtools/systems/jetto/_system.py

---------

Co-authored-by: Aaron Ho <a.ho@tue.nl>
Co-authored-by: Stef Smeets <s.smeets@esciencecenter.nl>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
  • Loading branch information
4 people authored Jan 16, 2024
1 parent be112f7 commit 5d6bde0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/duqtools/large_scale_validation/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def submit(*, array: bool, array_script: bool, limit: Optional[int],
Job(run.dirname, cfg=cfg)
for run in Locations(parent_dir=config_dir, cfg=cfg).runs)

if not jobs:
info('No jobs found.')
return

job_queue: Deque[Job] = deque()

for job in jobs:
Expand Down
5 changes: 4 additions & 1 deletion src/duqtools/schema/_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def npfunc(self,

# copyto is different, and does not like scalars
if self.operator == 'copyto' and not isinstance(data, np.ndarray):
return data
if isinstance(value, type(data)):
return value
else:
return data

if out is not None:
return npfunc(data, value, out=out)
Expand Down
4 changes: 2 additions & 2 deletions src/duqtools/systems/jetto/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class NamelistField(BaseModel):
section: str = Field(description='Section in the config.')

@field_validator('section')
def section_lower(cls, v):
return v.lower()
def section_upper(cls, v):
return v.upper()


JettoField = Annotated[Union[JsetField, NamelistField],
Expand Down
7 changes: 6 additions & 1 deletion src/duqtools/systems/jetto/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,13 @@ def set_jetto_variable(self,

jetto_config = config.RunConfig(jetto_template)

special_keys = (
't_start',
't_end',
)

# Do operation if present
if operation is not None:
if key not in special_keys and operation is not None:
data = jetto_config[key]
value = operation.npfunc(data, value, var=input_var)

Expand Down

0 comments on commit 5d6bde0

Please sign in to comment.