-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test utility scripts and update test docs
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Convert timeline_states.js to YAML timeline_states.yaml for easier comparison.""" | ||
|
||
import json | ||
import sys | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
data_dir = sys.argv[1] | ||
text = Path(f"{data_dir}/timeline_states.js").read_text() | ||
states = json.loads(text[11:]) | ||
yaml.dump(states, open(f"{data_dir}/timeline_states.yaml", "w")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Convert the now_date from timeline_states.js to a CxoTime date string.""" | ||
|
||
import json | ||
import sys | ||
from pathlib import Path | ||
|
||
from cxotime import CxoTime | ||
|
||
data_dir = sys.argv[1] | ||
text = Path(f"{data_dir}/timeline_states.js").read_text() | ||
data = json.loads(text[11:]) | ||
|
||
# Get date like "319/1215z" | ||
now_date = data["now_date"] | ||
year = CxoTime.now().date[:4] | ||
|
||
# Convert now_date to "{year}:319:12:15:00" | ||
date = f"{year}:{now_date[0:3]}:{now_date[4:6]}:{now_date[6:8]}:00" | ||
print(date) |