Skip to content

Commit

Permalink
Complete exmaple for handle_dimensions() method
Browse files Browse the repository at this point in the history
  • Loading branch information
jbousquin committed Sep 13, 2023
1 parent 559ed7d commit 5ce992f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions harmonize_wq/harmonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@ def fraction(self, frac_dict=None, suffix=None,
-------
frac_dict : dictionary
frac_dict updated to include any frac_col not already defined.
Examples
--------
Not fully implemented with TADA table yet
"""
c_mask = self.c_mask
if suffix is None:
Expand Down Expand Up @@ -771,6 +776,28 @@ def handle_dimensions(self):
mol_list : list
List of Mole (substance) units.
Examples
--------
Build DataFrame to use as input:
>>> import pandas
>>> df = pandas.DataFrame({'CharacteristicName': ['Phosphorus',
... 'Phosphorus',],
... 'ResultMeasure/MeasureUnitCode': ['mg/l',
... 'mg/kg',],
... 'ResultMeasureValue': ['1.0', '10',],
... })
>>> df
CharacteristicName ResultMeasure/MeasureUnitCode ResultMeasureValue
0 Phosphorus mg/l 1.0
1 Phosphorus mg/kg 10
Build WQ Characteristic Data object from DataFrame:
>>> wq = harmonize.WQCharData(df, 'Phosphorus')
>>> wq.handle_dimensions()
({'mg/kg': 'mg/kg * H2O'}, [])
"""
dimension_dict = {} # Empty dict to update to
mol_list = [] # Empty list to append to
Expand Down

0 comments on commit 5ce992f

Please sign in to comment.