Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 30, 2024
1 parent 8b339c6 commit 7cfd7c9
Showing 1 changed file with 15 additions and 6 deletions.
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

0 comments on commit 7cfd7c9

Please sign in to comment.