Skip to content

Commit

Permalink
Fix from database column in dataframe to align with first item of `…
Browse files Browse the repository at this point in the history
…from key`.
  • Loading branch information
romainsacchi committed Sep 29, 2024
1 parent 035f7e5 commit 0165615
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def package_files(directory):

setup(
name="unfold",
version="1.2.0",
version="1.2.1",
python_requires=">=3.10",
packages=packages,
author="Romain Sacchi <romain.sacchi@psi.ch>",
Expand Down
2 changes: 1 addition & 1 deletion unfold/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__all__ = ("Unfold", "Fold")
__version__ = (1, 2, 0)
__version__ = (1, 2, 1)


from .fold import Fold
Expand Down
6 changes: 5 additions & 1 deletion unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,13 @@ def format_superstructure_dataframe(self) -> None:
self.name or self.package.descriptor["name"]
)

# "from database" equals first item in "from key"
self.scenario_df.loc[
(self.scenario_df["flow type"] == "biosphere"), "from database"
] = "biosphere3"
] = self.scenario_df.loc[
(self.scenario_df["flow type"] == "biosphere"), "from key"
].apply(lambda x: x[0] if x is not None else None)

self.scenario_df = self.scenario_df[
[
"from activity name",
Expand Down

0 comments on commit 0165615

Please sign in to comment.