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

Allow setting volatile abundances as both metallicity or concentration #298

Merged
merged 9 commits into from
Nov 28, 2024

Conversation

nichollsh
Copy link
Contributor

@nichollsh nichollsh commented Nov 28, 2024

Following #292, this change extends the methods for setting the planet's volatile inventory.

It is now possible to set the volatiles as follows:

  • Hydrogen: equivalent Earth oceans (H_oceans) or relative to mantle mass (H_ppmw)
  • Carbon: as metallicity (CH_ratio) or relative to mantle mass (C_ppmw)
  • Nitrogen: as metallicity (NH_ratio) or relative to mantle mass (N_ppmw)
  • Sulfur: as metallicity (SH_ratio) or relative to mantle mass (S_ppmw)

The code prints an error and exits if more than one option is chosen for the same volatile.

Closes #296

@nichollsh nichollsh marked this pull request as ready for review November 28, 2024 09:26
Copy link
Member

@lsoucasse lsoucasse left a comment

Choose a reason for hiding this comment

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

I find this a little confusing. It feels like the user has to fill in both methods for each element in the config file.

What if we set a default value of zero for all these entries? Then we only write in the config file the non-zeros parameters. The checks you implemented make sure that we do not overprescribe.

@nichollsh
Copy link
Contributor Author

nichollsh commented Nov 28, 2024

Fair point - it could be confusing until they run the code and get an error. However, I do think that we should include in the configuration files all the possible parameters so that the user knows what is available. As we discussed before, it's likely that they will not immediately check the documentation*.

We could add default values of zero as you describe and then comment-out (but leave in the file) the unused parameters in the configuration. That way the user knows that they are available, but they aren't expected to actually provide both X_ppmw and XH_ratio at the same time. @lsoucasse what do you think of this?

* maybe we could add something in the code that prompts the user to check the docs if something fails?

@lsoucasse
Copy link
Member

Fair point - it could be confusing until they run the code and get an error. However, I do think that we should include in the configuration files all the possible parameters so that the user knows what is available. As we discussed before, it's likely that they will not immediately check the documentation*.

We could add default values of zero as you describe and then comment-out (but leave in the file) the unused parameters in the configuration. That way the user knows that they are available, but they aren't expected to actually provide both X_ppmw and XH_ratio at the same time. @lsoucasse what do you think of this?

  • maybe we could add something in the code that prompts the user to check the docs if something fails?

Commented the unused options is a good idea so that indeed the user know there is an alternative without looking at the doc. I am happy with this solution.

@nichollsh nichollsh merged commit fa011c6 into main Nov 28, 2024
5 checks passed
@nichollsh nichollsh deleted the hn/volatiles branch November 28, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set volatile abundances in absolute and relative terms
2 participants