Skip to content

Commit

Permalink
Update instance.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyuba Zehl committed Jul 20, 2023
1 parent eaf5586 commit 512748a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pipeline/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def _build_multi_version_links(self, versionReferenceList:Dict, versions:Dict, t
linklist = []
for versionReference in versionReferenceList:
linklist.append(self._build_single_version_link(versionReference, versions, title))
return ", ".join(sorted(linklist))
reversed_linklist = list(reversed(sorted(linklist)))
return f"| {'\n| '.join(reversed_linklist)}"

def _build_terminology(self, target_file:str, title:str, data_to_display:Dict):
with open(f"{target_file}.rst", "w") as output_file:
Expand Down Expand Up @@ -292,7 +293,7 @@ def _build_brain_atlas(self, target_file:str, title:str, data_to_display:Dict):
doc.field(name="abbreviation", value=d_abbr, indent=field_list_indent)
d_species = self._build_single_term_link(data["usedSpecies"], "species") if "usedSpecies" in data and data["usedSpecies"] else "\-"
doc.field(name="used species", value=d_species, indent=field_list_indent)
d_digitalID = data["digitalIdentifier"] if "digitalIdentifier" in data and data["digitalIdentifier"] else "\-"
d_digitalID = data["digitalIdentifier"]["@id"] if "digitalIdentifier" in data and data["digitalIdentifier"] else "\-"
doc.field(name="digital ID", value=d_digitalID, indent=field_list_indent)
d_ontologyID = data["ontologyIdentifier"] if "ontologyIdentifier" in data and data["ontologyIdentifier"] else "\-"
doc.field(name="ontology ID", value=d_ontologyID, indent=field_list_indent)
Expand Down Expand Up @@ -459,4 +460,4 @@ def build(self):
ccs_title = ccs_data["space"]["shortName"]
target_file = self._target_file_without_extension("/".join(["commonCoordinateSpaces", ccs_title]))
os.makedirs(os.path.dirname(target_file), exist_ok=True)
self._build_common_coordinate_space(target_file, ccs_title, ccs_data)
self._build_common_coordinate_space(target_file, ccs_title, ccs_data)

0 comments on commit 512748a

Please sign in to comment.