Skip to content

Commit e5780db

Browse files
authored
Simplify Author List (#83)
1 parent 2d6a803 commit e5780db

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

src/pals/PALS.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@ def unpack_json_structure(cls, data):
8888
data = inner
8989
data = dict(data)
9090

91-
# Authors are written as one-key `author:` dicts; unwrap them.
92-
if isinstance(data.get("authors"), list):
93-
data["authors"] = [
94-
entry["author"]
95-
if isinstance(entry, dict) and set(entry) == {"author"}
96-
else entry
97-
for entry in data["authors"]
98-
]
99-
10091
# Unpack each facility element's name; facility is optional.
10192
if data.get("facility") is not None:
10293
if not isinstance(data["facility"], list):
@@ -113,13 +104,6 @@ def model_dump(self, *args, **kwargs):
113104
# Keep `version` in the output even when unset.
114105
data = {"version": self.version, **data}
115106

116-
# Restore the one-key `author:` form of each authors entry.
117-
if self.authors is not None:
118-
data["authors"] = [
119-
{"author": author.model_dump(*args, **kwargs)}
120-
for author in self.authors
121-
]
122-
123107
# Reformat facility elements into their one-key named form.
124108
if self.facility is not None:
125109
data["facility"] = [elem.model_dump(**kwargs) for elem in self.facility]

tests/standard_examples_git_reference.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
#
88
# The first non-comment line is the pin: a full commit SHA of
99
# https://github.com/pals-project/pals
10-
5c39fde043ddad7a961ede01a5ad73d90b098aec
10+
7ffec924f6109bebfb6a54196737ab48893a9a9f

0 commit comments

Comments
 (0)