Skip to content

Commit

Permalink
[FIX] Enable fetch of phase transition data (#112)
Browse files Browse the repository at this point in the history
* add phasetransitions fetch to tests

* add phasetransition table to fetch

* update readthedocs config
  • Loading branch information
lmmentel authored Jun 7, 2023
1 parent 7f758ef commit c8f3e78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion mendeleev/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def fetch_table(table: str, **kwargs) -> pd.DataFrame:
tables = {
"elements",
"groups",
"isotopes",
"ionicradii",
"ionizationenergies",
"isotopedecaymodes",
"isotopes",
"oxidationstates",
"phasetransitions",
"screeningconstants",
"series",
}
Expand Down
6 changes: 5 additions & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ sphinx:
# Optionally build your docs in additional formats such as PDF and ePub
formats: all

build:
os: ubuntu-22.04
tools:
python: "3.11"

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- method: pip
path: .
Expand Down
6 changes: 1 addition & 5 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,24 @@
("groups", 18),
("series", 10),
("oxidationstates", 579),
("phasetransitions", 108),
]


@pytest.mark.parametrize("table,nrows", tables)
def test_fetch_table(table, nrows):

df = fetch_table(table)
assert isinstance(df, pd.DataFrame)
assert df.shape[0] == nrows


def test_fetch_neutral_data():

df = fetch_neutral_data()
assert isinstance(df, pd.DataFrame)


@pytest.mark.parametrize("radius", ("ionic_radius", "crystal_radius"))
def test_fetch_ionic_radii(radius):

df = fetch_ionic_radii(radius)
assert isinstance(df, pd.DataFrame)

Expand All @@ -46,13 +44,11 @@ def test_fetch_ionic_radii(radius):
((1, ["IE1"]), ([1, 2], ["IE1", "IE2"]), ([1, 2, 6], ["IE1", "IE2", "IE6"])),
)
def test_fetch_ionization_energies(degree, cols):

df = fetch_ionization_energies(degree)
assert isinstance(df, pd.DataFrame)
assert all(col in df.columns for col in cols)


def test_fetch_electronegativities():

df = fetch_electronegativities()
assert isinstance(df, pd.DataFrame)

0 comments on commit c8f3e78

Please sign in to comment.