Skip to content

Commit

Permalink
Fix formatting of string for SDF export.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Oct 7, 2023
1 parent 6830d40 commit a8b0632
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion unfold/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,10 @@ def write(self, superstructure: bool = False, export_dir: str = None):
else:
source_db = {"name": "unknown", "version": "unknown"}

filename = f"SDF {source_db['name']} {source_db['version']} {self.name or self.package.descriptor['name']}.csv"
if self.name:
filename = f"SDF {source_db['name']} {self.name}.csv"
else:
filename = f"SDF {source_db['name']} {source_db['version']} {self.package.descriptor['name']}.csv"

if export_dir is None:
export_dir = os.getcwd()
Expand Down

1 comment on commit a8b0632

@romainsacchi
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adresses #10

Please sign in to comment.