Skip to content

fix(examples): async_chain_ops tempdir + creator chain path (#388)#390

Merged
joaquinbejar merged 1 commit into
mainfrom
issue-388-example-io
Apr 19, 2026
Merged

fix(examples): async_chain_ops tempdir + creator chain path (#388)#390
joaquinbejar merged 1 commit into
mainfrom
issue-388-example-io

Conversation

@joaquinbejar
Copy link
Copy Markdown
Owner

Summary

  • `async_chain_ops`: `save_to_json_async`/`save_to_csv_async` take a directory and internally append `{title}.{ext}`. The example previously passed `async_chain.json` as the directory, which made the inner `File::create` fail with ENOENT. Route the paths through `std::env::temp_dir().join("optionstratlib-async-chain-ops")` and create it up front.
  • `creator`: point the hard-coded JSON path at `Germany-40-2025-05-27-15-29-00-UTC-24209.json` that actually ships in `examples/Chains/` instead of `2025-06-13-16:00:00-UTC-23794.5.json` which was never committed.

Both example binaries now run to completion.

Closes #388.

Test plan

  • `cargo run --manifest-path=examples/examples_chain/Cargo.toml --bin async_chain_ops` — clean run + round-trips.
  • `cargo run --manifest-path=examples/examples_chain/Cargo.toml --bin creator` — clean run with best-area + delta adjustment.

…pped chain (#388)

- `async_chain_ops`: `save_to_json_async`/`save_to_csv_async` take a
  *directory* and append `{title}.{ext}`. The example previously passed
  "async_chain.json" as a directory, so the inner `File::create` hit
  ENOENT. Route the paths through
  `std::env::temp_dir().join("optionstratlib-async-chain-ops")` and
  create it up front.
- `creator`: point the hard-coded JSON path at the Germany-40 chain
  that actually ships in `examples/Chains/` (`Germany-40-2025-05-27-15-29-00-UTC-24209.json`)
  instead of the `2025-06-13-16:00:00-UTC-23794.5` file that was
  never committed.

Both example binaries now run to completion.

Closes #388.
@joaquinbejar joaquinbejar merged commit f647e2b into main Apr 19, 2026
11 checks passed
@joaquinbejar joaquinbejar deleted the issue-388-example-io branch April 19, 2026 21:55
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples: chain examples async_chain_ops and creator fail with file I/O error

1 participant