Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we move the "version" setting out of metadata? #1267

Closed
john-science opened this issue May 17, 2023 · 5 comments · Fixed by #1274
Closed

Can we move the "version" setting out of metadata? #1267

john-science opened this issue May 17, 2023 · 5 comments · Fixed by #1274
Assignees
Labels
architecture Issues related to big picture system architecture

Comments

@john-science
Copy link
Member

Right now, all settings in the CaseSetting object are easily retrieved through the simple method:

cs["nCycles"]

This is great. It easy to use and clear.

However, one setting is unique and different: "version" is the version of ARMI the simulation was run with, and it is in a special "metadata" area, outside the settings:

https://github.com/terrapower/armi/blob/fc26c390e01ce541e5f66fb530a89ada2479a6e9/armi/tests/armiRun.yaml#L1C1-L2

This is pretty annoying. Because you can't just do cs["metadata"] or cs["version"] or anything. But people have frequently asked me how to get this information programmatically, because they need it. And I have to write them some code that fines and parses the YAML file in question NOT using ARMI or yamlize.

It would be an API change, but it feels like we should just remove the metadata tag entirely from this file, and make version a regular setting.

@john-science john-science added the architecture Issues related to big picture system architecture label May 17, 2023
@john-science john-science self-assigned this May 17, 2023
@john-science
Copy link
Member Author

Alternately, I have opened a yamlize ticket to see if there is an easy work-around I can bake into the CaseSetting class without having to change our settings files or API.

@john-science
Copy link
Member Author

Also related #1234

@jakehader
Copy link
Member

@drewj-usnctech - the introduction of version might have been something that we had discussed for your needs. If so, can you take a look at #1234 and see if we can remove the setting for version and just slap it into a database? Maybe the version number predates this though.

@john-science - it might be that version was / is used in the settings for auto migration purposes. I'm not sure the history there but @ntouran could remember. I still think that the tagged issue is a good one but might be independent here.

@drewj-usnctech
Copy link
Contributor

@drewj-usnctech - the introduction of version might have been something that we had discussed for your needs

I brought up some metadata/version questions in #1066 but I wasn't the originator of that section. I'll put some similar comments in #1234

As @john-science put in #1066 (comment), it's totally possible for any plugin to define their own "version-as-a-setting" and do their own validation already.

settings:
   armiVersion: 0.2.6
   mySnazzyAppVersion: 0.1.0
   coolPluginVersion: 2.4.1

I would ask that there's some way to consolidate these, since collecting them all in a settings/version table

settings:
  versions:
    armi: 0.2.6
    mySnazzyApp: 0.1.0
    coolPlugin: 2.4.1

has a better UI (in my own opinion)

p.s. this could open the door to version constraining later, e.g.,

settings:
 versions:
   armi: >=0.2.6
   my snazzy app: <0.2.0

which would be awesome but a much harder lift.

@john-science
Copy link
Member Author

@drewj-usnctech Thanks!

Also, this is my current favorite:

settings:
  versions:
    armi: 0.2.6
    mySnazzyApp: 0.1.0
    coolPlugin: 2.4.1

@john-science john-science linked a pull request May 23, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Issues related to big picture system architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants