Skip to content

Conversation

@giordano
Copy link
Contributor

@giordano giordano commented May 2, 2023

The advantage is that we can automatically convert nested mappings, like for example the extra_resources attribute, which can thus be set from the command line.

This is the kind of change I'd like to propose to fix #2868. If this is deemed acceptable, I'll add some tests.

@jenkins-cscs
Copy link
Collaborator

Can I test this patch?

@vkarak
Copy link
Contributor

vkarak commented May 4, 2023

What would be the syntax for setting a nested dict from the command line? Could you give an example?

@giordano
Copy link
Contributor Author

giordano commented May 5, 2023

Something like

-S extra_resources=a:{b:c, d:{e:f}},g:h

The advantage is that we can automatically convert nested mappings, like for
example the `extra_resources` attribute, which can thus be set from the command
line.
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (53ee447) 87.35% compared to head (dbf0596) 87.35%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2876   +/-   ##
========================================
  Coverage    87.35%   87.35%           
========================================
  Files           60       60           
  Lines        11676    11680    +4     
========================================
+ Hits         10199    10203    +4     
  Misses        1477     1477           
Impacted Files Coverage Δ
reframe/utility/typecheck.py 97.40% <100.00%> (+0.05%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@giordano
Copy link
Contributor Author

giordano commented Jul 3, 2023

Bump 🙂

@vkarak vkarak added this to the ReFrame 4.4 milestone Jul 3, 2023
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm; I've done a couple of style fixes. We'd need also to update the docs of the -S option.

Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the docs; it's fine now.

@vkarak vkarak changed the title [feat] Parse convertible mapping objects with json module [feat] Allow setting nested mapping types using the -S option Jul 3, 2023
@vkarak vkarak merged commit fb385e1 into reframe-hpc:develop Jul 3, 2023
@giordano
Copy link
Contributor Author

giordano commented Jul 4, 2023

Thank you!

@giordano giordano deleted the mg/convert-json branch July 4, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Feature request: set multi-level dictionaries from the command line

3 participants