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

Add string and chemical formulae utility functions #141

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

sjdaines
Copy link
Member

@sjdaines sjdaines commented Nov 30, 2024

"""
    parse_number_name(nname::AbstractString) -> (number, name)

Parse a string of form "-1*A"

"""

"""
    ChemistryUtils.parse_chemical_formula(formula::AbstractString) -> element_counts::OrderedDict{Symbol, Float64}

Parse a chemical formula into a Dict of element counts 
"""

"""
    ChemistryUtils.calc_molar_mass(element_counts::AbstractDict) -> molar_mass::Float64

Add up element masses to get molar mass (g)
"""

"""
    Constants.STANDARD_ATOMIC_WEIGHTS

IUPAC recommended values of relative atomic masses of sources in the local environment of the Earth's crust and atmosphere (ie with Earth-specific isotope composition)
"""

"""
    parse_number_name(nname::AbstractString) -> (number, name)

Parse a string of form "-1*A"

"""

"""
    ChemistryUtils.parse_chemical_formula(formula::AbstractString) -> element_counts::OrderedDict{Symbol, Int64}

Parse a chemical formula into a Dict of element counts
"""

"""
    ChemistryUtils.calc_molar_mass(element_counts::AbstractDict) -> molar_mass::Float64

Add up element masses to get molar mass (g)
"""

"""
    Constants.STANDARD_ATOMIC_WEIGHTS

IUPAC recommended values of relative atomic masses of sources in the local environment of the Earth's crust and atmosphere
(ie with Earth-specific isotope composition)
"""
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 75.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 53.98%. Comparing base (9135e8a) to head (b770312).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/StringUtils.jl 68.75% 5 Missing ⚠️
src/Model.jl 0.00% 2 Missing ⚠️
src/Types.jl 0.00% 2 Missing ⚠️
src/utils/ChemistryUtils.jl 94.44% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   54.88%   53.98%   -0.91%     
==========================================
  Files          39       41       +2     
  Lines        4267     4007     -260     
==========================================
- Hits         2342     2163     -179     
+ Misses       1925     1844      -81     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjdaines sjdaines merged commit 0d24f31 into main Nov 30, 2024
3 checks passed
@sjdaines sjdaines deleted the chemistry_string_parsing branch November 30, 2024 17:12
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.

2 participants