Skip to content

Commit

Permalink
Merge pull request #159 from paulsaxe/main
Browse files Browse the repository at this point in the history
Corrected issue with citations in development versions
  • Loading branch information
seamm committed Jan 2, 2024
2 parents 44d95ea + efa9229 commit e206f3d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2024.1.2 -- Corrected issue with citations in development versions
* Fixed an issue getting the date of a plug-in for development versions of the
plug-in. This did not affect end users, but did casue issues for development.

2023.12.18 -- Moving execution of flowcharts to seamm-exec
* Moved execution of flowcharts to seamm-exec to consolidate execution in one
place. This will allow easier, faster developement for running in queues, etc.
Expand Down
20 changes: 17 additions & 3 deletions seamm/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import bibtexparser
import calendar
import collections.abc
from datetime import datetime
import hashlib

try:
Expand Down Expand Up @@ -728,9 +729,22 @@ def run(self, printer=None):
template = string.Template(self._bibliography[package])

version = self.version
year, month = version.split(".")[0:2]
month = calendar.month_abbr[int(month)].lower()
citation = template.substitute(month=month, version=version, year=year)
if "untagged" in version:
# Development version
year = datetime.now().year
month = datetime.now().month
else:
year, month = version.split(".")[0:2]
try:
month = calendar.month_abbr[int(month)].lower()
except Exception:
year = datetime.now().year
month = datetime.now().month
month = calendar.month_abbr[int(month)].lower()

citation = template.substitute(
month=month, version=version, year=str(year)
)

title = package.split("_")
title = " ".join([s.capitalize() for s in title[0:-2]])
Expand Down

0 comments on commit e206f3d

Please sign in to comment.