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

Provide functions for reference data #312

Merged
merged 23 commits into from
Jul 30, 2024
Merged
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a0d5c55
Provide functions for reference data
jan-janssen Jul 29, 2024
dc43179
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
86a1645
Add a first set of unit tests
jan-janssen Jul 29, 2024
e141423
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
035d69d
update dependencies
jan-janssen Jul 29, 2024
fe58857
Merge remote-tracking branch 'refs/remotes/origin/reference_data' int…
jan-janssen Jul 29, 2024
9f01b57
fix import
jan-janssen Jul 29, 2024
6de6fed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
be84a5d
Add lxml
jan-janssen Jul 29, 2024
a013161
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
8b339c6
Add docstrings and type hints with co-pilot
jan-janssen Jul 30, 2024
7cfd7c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
d4d94a7
add coderabbit recommendations
jan-janssen Jul 30, 2024
9830680
Merge branch 'reference_data' of github.com:pyiron/atomistics into re…
jan-janssen Jul 30, 2024
d221132
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
e820d3f
Merge pull request #315 from pyiron/main
jan-janssen Jul 30, 2024
fa0929b
Following Sam's suggestion - renamed get_experimental_elastic_propert…
jan-janssen Jul 30, 2024
dcb287a
Support both:
jan-janssen Jul 30, 2024
fe3c0d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
031632d
Fix wikipedia docstring
jan-janssen Jul 30, 2024
92cf77a
Merge remote-tracking branch 'refs/remotes/origin/reference_data' int…
jan-janssen Jul 30, 2024
d9d4a83
Update environment-old.yml
jan-janssen Jul 30, 2024
c744330
Update environment-old.yml
jan-janssen Jul 30, 2024
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
21 changes: 15 additions & 6 deletions atomistics/referencedata/wolfram.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import Tuple, Union, Optional, Callable, List
from typing import Callable, List, Optional, Tuple, Union

import numpy as np
import pandas
Expand Down Expand Up @@ -43,10 +43,10 @@ def _select_function_density(v: str) -> float:
def _select_function_split(v: Union[str, float]) -> float:
"""
Splits a string and returns the first element as a float.

Args:
v (Union[str, float]): The input value to be processed.

Returns:
float: The first element of the input string as a float, or the input value if it's already a float.
"""
Expand Down Expand Up @@ -168,7 +168,12 @@ def _select_function_mass(v: Union[str, float]) -> Union[float, str]:
return v


def _extract_lst(df: pandas.DataFrame, column: str, select_function: Callable, current_filter: Callable) -> Tuple[List[str], List[str]]:
def _extract_lst(
df: pandas.DataFrame,
column: str,
select_function: Callable,
current_filter: Callable,
) -> Tuple[List[str], List[str]]:
"""
Extracts element and property lists from a DataFrame based on the given column, select function, and current filter.

Expand Down Expand Up @@ -197,7 +202,9 @@ def _extract_lst(df: pandas.DataFrame, column: str, select_function: Callable, c
return element_lst, property_lst


def _collect(url: str, column: str, select_function: callable, current_filter: callable) -> pandas.DataFrame:
def _collect(
url: str, column: str, select_function: callable, current_filter: callable
) -> pandas.DataFrame:
"""
Collect data from a given URL and extract specific properties.

Expand Down Expand Up @@ -226,7 +233,9 @@ def _collect(url: str, column: str, select_function: callable, current_filter: c
)


def _get_volume(lat_lst: Union[float, Tuple[float, float, float]], crystal: str) -> Optional[float]:
def _get_volume(
lat_lst: Union[float, Tuple[float, float, float]], crystal: str
) -> Optional[float]:
"""
Calculate the volume of a crystal unit cell.

Expand Down
Loading