Skip to content

Commit

Permalink
style: use more verbose function name
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLoecker committed Dec 9, 2024
1 parent 826579b commit 141cdea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/como/create_context_specific_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def _build_model( # noqa: C901
)


def _create_df(path: Path) -> pd.DataFrame:
def _create_df_from_file(path: Path) -> pd.DataFrame:
match path.suffix:
case ".csv":
df = pd.read_csv(path, header=0, sep=",")
Expand All @@ -547,7 +547,7 @@ def _create_df(path: Path) -> pd.DataFrame:


def _collect_boundary_reactions(path: Path) -> _BoundaryReactions:
df = _create_df(path)
df = _create_df_from_file(path)
for column in df.columns:
if column not in [
"reaction",
Expand Down Expand Up @@ -642,15 +642,15 @@ def create_context_specific_model( # noqa: C901
exclude_rxns: list[str] = []
if exclude_rxns_filepath:
exclude_rxns_filepath: Path = Path(exclude_rxns_filepath)
df = _create_df(exclude_rxns_filepath)
df = _create_df_from_file(exclude_rxns_filepath)
if "abbreviation" not in df.columns:
raise ValueError("The exclude reactions file should have a single column with a header named Abbreviation")
exclude_rxns = df["abbreviation"].tolist()

force_rxns: list[str] = []
if force_rxns_filepath:
force_rxns_filepath: Path = Path(force_rxns_filepath)
df = _create_df(force_rxns_filepath)
df = _create_df_from_file(force_rxns_filepath)
if "abbreviation" not in df.columns:
raise ValueError("The force reactions file should have a single column with a header named Abbreviation")
force_rxns = df["abbreviation"].tolist()
Expand Down

0 comments on commit 141cdea

Please sign in to comment.