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

[FIX] Enable fetch of phase transition data #112

Merged
merged 3 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)