Skip to content

Commit

Permalink
Handle software without a given version
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Sep 7, 2023
1 parent 8243e20 commit c84a653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ihm/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def report_citations(self):
def report_software(self):
r = self._section("Software used")
for s in ihm._remove_identical(self.system._all_software()):
r.report("- %s (version %s)" % (s.name, s.version))
if s.version is None:
r.report("- %s (no version given)" % s.name)
else:
r.report("- %s (version %s)" % (s.name, s.version))
if not s.citation:
warnings.warn(
"No citation provided for %s" % s, MissingDataWarning)
Expand Down
1 change: 1 addition & 0 deletions test/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def test_software(self):
page_range=(10, 20), year=2023,
authors=["foo", "bar"], doi="test")
soft.citation = c
soft.version = None
r.report_software()

def test_databases(self):
Expand Down

0 comments on commit c84a653

Please sign in to comment.