Skip to content
This repository was archived by the owner on Mar 4, 2022. It is now read-only.

Commit 01fd652

Browse files
committed
Add timestamp to generated file
1 parent bd7c30b commit 01fd652

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

celestia_wuma/wuma.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
"""Creates the W UMa catalog."""
1919

20+
from datetime import date
2021
import os
2122
import os.path
2223
import string
@@ -204,7 +205,7 @@ def _guess_spectrum(temp: float) -> str:
204205
return sptype
205206

206207

207-
def _write_header(
208+
def _write_star_header(
208209
f: TextIO, row: Row, name: Optional[str], cel_names: Dict[int, List[str]]
209210
) -> Optional[Tuple[Optional[str], str]]:
210211
# Use the spectral types with the following preference:
@@ -289,7 +290,7 @@ def create_stars(celestia_dir: str, f: TextIO, tbl: Table) -> None:
289290
)
290291
name = apply_cel_convention(row['Name'])
291292

292-
spectrum_info = _write_header(f, row, name, cel_names)
293+
spectrum_info = _write_star_header(f, row, name, cel_names)
293294
if spectrum_info is None:
294295
continue
295296

@@ -312,6 +313,7 @@ def build_catalog(celestia_dir: str) -> None:
312313
tbl = merge_data()
313314
with open(os.path.join('output', 'wuma.stc'), 'w') as f:
314315
f.write(HEADER)
316+
f.write(f'\n# Generated on {date.today().isoformat()}\n')
315317
create_stars(celestia_dir, f, tbl)
316318

317319
print("Creating archive")

0 commit comments

Comments
 (0)