Skip to content
Open
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
16 changes: 0 additions & 16 deletions src/pals/PALS.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ def unpack_json_structure(cls, data):
data = inner
data = dict(data)

# Authors are written as one-key `author:` dicts; unwrap them.
if isinstance(data.get("authors"), list):
data["authors"] = [
entry["author"]
if isinstance(entry, dict) and set(entry) == {"author"}
else entry
for entry in data["authors"]
]

# Unpack each facility element's name; facility is optional.
if data.get("facility") is not None:
if not isinstance(data["facility"], list):
Expand All @@ -113,13 +104,6 @@ def model_dump(self, *args, **kwargs):
# Keep `version` in the output even when unset.
data = {"version": self.version, **data}

# Restore the one-key `author:` form of each authors entry.
if self.authors is not None:
data["authors"] = [
{"author": author.model_dump(*args, **kwargs)}
for author in self.authors
]

# Reformat facility elements into their one-key named form.
if self.facility is not None:
data["facility"] = [elem.model_dump(**kwargs) for elem in self.facility]
Expand Down
2 changes: 1 addition & 1 deletion tests/standard_examples_git_reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#
# The first non-comment line is the pin: a full commit SHA of
# https://github.com/pals-project/pals
5c39fde043ddad7a961ede01a5ad73d90b098aec
7ffec924f6109bebfb6a54196737ab48893a9a9f

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.