Skip to content

Commit 35199fa

Browse files
committed
Migrate timestamp format from YYYY-MM-DD-HH-MM-SS to YYYY-MM-DD_HH-MM-SS
1 parent 1b3b4be commit 35199fa

10 files changed

Lines changed: 12 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ octane
112112
Use Octane to make figures for your paper:
113113

114114
```bash
115-
octane draw -t ~/.highjax/t/2026-03-15-20-02-25-101327 --epoch 300 -e 0 --timestep 19 --theme light \
115+
octane draw -t ~/.highjax/t/2026-03-15_20-02-25_101327 --epoch 300 -e 0 --timestep 19 --theme light \
116116
--zoom 1.8 --png ~/figure.png
117117
```
118118

docs/Octane/Octane overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ Data is loaded from `sample_es.parquet` (preferred, used by modern HighJax runs;
5656

5757
## Trek discovery
5858

59-
On startup, Octane scans `~/.highjax/t/` (or `$HIGHJAX_HOME/t/`) for directories containing `meta.yaml` or `sample_es.parquet`. Results are sorted by directory name (timestamp format like `2026-01-31-02-13-44-322216`), so the most recent trek appears last.
59+
On startup, Octane scans `~/.highjax/t/` (or `$HIGHJAX_HOME/t/`) for directories containing `meta.yaml` or `sample_es.parquet`. Results are sorted by directory name (timestamp format like `2026-01-31_02-13-44_322216`), so the most recent trek appears last.
6060

6161
Timing metadata comes from `meta.yaml`: `seconds_per_t` (policy timestep duration) and `seconds_per_sub_t` (sub-timestep duration, for environments with sub-stepping).
6262

6363
## Producing treks
6464

65-
Treks are produced by running `highjax-trainer train`, which writes outputs to `~/.highjax/t/` (or `$HIGHJAX_HOME/t/`). Each training run creates a timestamped directory (e.g. `2026-01-31-02-13-44-322216`) containing `meta.yaml`, epoch data, and optionally `sample_es.parquet` with sampled episodes.
65+
Treks are produced by running `highjax-trainer train`, which writes outputs to `~/.highjax/t/` (or `$HIGHJAX_HOME/t/`). Each training run creates a timestamped directory (e.g. `2026-01-31_02-13-44_322216`) containing `meta.yaml`, epoch data, and optionally `sample_es.parquet` with sampled episodes.
6666

6767
## CLI usage
6868

@@ -71,7 +71,7 @@ Treks are produced by running `highjax-trainer train`, which writes outputs to `
7171
octane
7272

7373
# Open a specific trek
74-
octane -t ~/.highjax/t/2026-01-31-02-13-44-322216
74+
octane -t ~/.highjax/t/2026-01-31_02-13-44_322216
7575

7676
# Open a breakdown parquet directly (auto-finds trek via meta.yaml)
7777
octane -t ~/.highjax/t/2026-.../breakdown/2026-..._a0_e200-200_.../es.parquet

docs/Trainer/Trainer training.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ All PPO hyperparameters live in `AgentConfig`:
9292
Training with trek enabled (the default) creates a timestamped directory under `~/.highjax/t/` (or `$HIGHJAX_HOME/t/`). Set `$HIGHJAX_HOME` to override the default `~/.highjax/` root. All data (treks, behaviors, config, logs) will use `$HIGHJAX_HOME/` instead.
9393

9494
```
95-
~/.highjax/t/2026-03-15-20-02-25-101327/
95+
~/.highjax/t/2026-03-15_20-02-25_101327/
9696
meta.yaml # Environment config, git info, parameter counts
9797
sample_es.pq # Sampled episode trajectories
9898
epochia.pq # Epoch-level metrics

highjax_trainer/ozette/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def sanitize_for_filename(s: str, max_len: int = 50) -> str:
2121

2222
def make_log_filename(timestamp: datetime.datetime, argv: Optional[list[str]] = None) -> str:
2323
'''Create log filename from timestamp and optional argv.'''
24-
ts_str = timestamp.strftime('%Y-%m-%d-%H-%M-%S')
24+
ts_str = timestamp.strftime('%Y-%m-%d_%H-%M-%S')
2525

2626
if argv and len(argv) > 1:
2727
cmd_str = ' '.join(argv[1:])

highjax_trainer/trekking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _get_highjax_treks() -> pathlib.Path:
3232
def _make_timestamp_name() -> str:
3333
now = datetime.datetime.now()
3434
return (
35-
now.strftime('%Y-%m-%d-%H-%M-%S-') + f'{now.microsecond:06d}'
35+
now.strftime('%Y-%m-%d_%H-%M-%S_') + f'{now.microsecond:06d}'
3636
)
3737

3838

octane/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::render::RenderConfig;
2121
use crate::util::{find_parquet_file, posh_path};
2222

2323
/// Find the most recent trek in ~/.highjax/t/.
24-
/// Treks are directories with timestamp names (e.g., 2026-01-31-02-13-44-322216).
24+
/// Treks are directories with timestamp names (e.g., 2026-01-31_02-13-44_322216).
2525
/// Selects the newest by directory name.
2626
fn find_latest_trek() -> Option<PathBuf> {
2727
let home = std::env::var("HOME").ok()?;

octane/src/data/trek.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ pub struct ParquetSource {
540540
/// Short display name (e.g. "sample_es" or breakdown run name) for UI.
541541
pub display: String,
542542
/// Path relative to trek root (e.g. "sample_es.parquet" or
543-
/// "breakdown/2026-02-20-13-07-24_a0_e100-100_mm500_jfj/es.parquet").
543+
/// "breakdown/2026-02-20_13-07-24_a0_e100-100_mm500_jfj/es.parquet").
544544
/// Used for `-t` CLI matching when target is a parquet file.
545545
pub relative_path: String,
546546
}

octane/src/leona/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn init(config: LogConfig) -> Result<PathBuf> {
7171

7272
// Generate log filename with timestamp
7373
let now = Local::now();
74-
let timestamp = now.format("%Y-%m-%d-%H-%M-%S");
74+
let timestamp = now.format("%Y-%m-%d_%H-%M-%S");
7575
let log_filename = format!("{timestamp}_{}.log", config.app_name);
7676
let log_path = logs_dir.join(&log_filename);
7777

tests/test_highjax_trainer/test_ozette/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_log_path_format(self, temp_base_dir):
207207
log_path = ozette.get_log_path()
208208
assert log_path.parent.name == 'logs'
209209
assert log_path.parent.parent.name == '.test_path_fmt'
210-
assert re.match(r'\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}', log_path.name)
210+
assert re.match(r'\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}', log_path.name)
211211
assert log_path.name.endswith('.log')
212212

213213
def test_install_returns_instance(self, temp_base_dir):

tests/test_highjax_trainer/test_trekking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ def test_create_trek_timestamp_format(self, tmp_path, env_and_params,
8080
monkeypatch.setenv('HIGHJAX_HOME', str(tmp_path))
8181
trek_path = create_trek(env, params, agent_config)
8282
name = trek_path.name
83-
pattern = r'^\d{4}-\d{2}-\d{2}-\d{2}-\d{2}-\d{2}-\d{6}$'
83+
pattern = r'^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}_\d{6}$'
8484
assert re.match(pattern, name), f'Name {name!r} does not match timestamp pattern'
8585
assert trek_path.parent == tmp_path / 't'

0 commit comments

Comments
 (0)