Skip to content

Commit

Permalink
Update geochem.transform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Jun 16, 2021
1 parent cd9277b commit f96b1bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions test/geochem/geochem_pyrochem.py
Expand Up @@ -108,16 +108,6 @@ def test_pyrochem_add_MgNo(self):
obj.pyrochem.add_MgNo()
self.assertIn("Mg#", obj.columns)

def test_pyrochem_add_MgNo_ferricferrous(self):
obj = self.df.copy(deep=True).pyrochem.compositional
obj.pyrochem.add_MgNo()
obj.pyrochem.recalculate_Fe(to=dict(FeO=0.9, Fe2O3=0.1))
obj.pyrochem.add_MgNo(name="Mg#2")
self.assertIn("Mg#", obj.columns)
self.assertIn("Fe2O3", obj.columns)
self.assertIn("Mg#2", obj.columns)
self.assertFalse(np.isclose(obj["Mg#"].values, obj["Mg#2"].values).any())

def test_pyrochem_add_ratio(self):
obj = self.df.copy(deep=True)

Expand Down Expand Up @@ -149,13 +139,6 @@ def test_pyrochem_lambda_lnREE(self):
self.assertIsInstance(lambdas, pd.DataFrame)
self.assertIn("λ0", lambdas.columns)

def test_pyrochem_recalculate_Fe(self):
obj = self.df.copy(deep=True)
obj.pyrochem.recalculate_Fe(to=dict(FeO=0.9, Fe2O3=0.1))
self.assertIn("Fe2O3", obj.columns)
self.assertIn("FeO", obj.columns)
self.assertTrue((obj.FeO.values > obj.Fe2O3.values).all())

def test_pyrochem_convert_chemistry(self):
obj = self.df.copy(deep=True)
obj = obj.pyrochem.convert_chemistry(
Expand Down
2 changes: 1 addition & 1 deletion test/geochem/geochem_transform.py
Expand Up @@ -316,7 +316,7 @@ def test_renorm(self):
with self.subTest(renorm=renorm):
reddf = aggregate_element(self.df, to=to, renorm=renorm)
if renorm:
self.assertTrue((reddf.sum(axis=1) == 100.0).all())
self.assertTrue(np.isclose(reddf.sum(axis=1), 100.0).all())
else:
# the reduced columns will be dropped,
pass
Expand Down

0 comments on commit f96b1bd

Please sign in to comment.