Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename docs to demos #22

Merged
merged 5 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true

- name: Rust unit tests
run: |
cd rust/
cargo test
cd rust/ && cargo test
- name: Python unit tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ recursive-include rust/fastsim-core/src *
recursive-include rust/fastsim-core/proc-macros/src *
recursive-include rust/fastsim-py/src *
recursive-include rust/fastsim-cli/src *
recursive-include fastsim/resources *
recursive-include fastsim/docs *
recursive-include python/fastsim/resources *
recursive-include python/fastsim/demos *
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ Developers might want to install the code in place so that FASTSim files can be
1. Within the same python environment, navigate to `fastsim/rust/` and run
`pip install maturin`.
1. _Optional_: Within the `rust/` folder (which contains the rust `src/` folder), run `cargo test --release` to build and run the tests.
1. In `fastsim/rust/fastsim-py`, you should now be able to run `maturin develop --release`, which will enable the tests that use rust to run. You should also now be able to run `fastsim/fastsim/docs/demo.py`.
1. In `./rust/fastsim-py`, you should now be able to run `maturin develop --release`, which will enable the tests that use rust to run. You should also now be able to run `./python/fastsim/demos/demo.py`.

After FASTSim has been installed as editable per the above instructions, you can rebuild and test everything with `sh build_and_test.sh` in Windows bash or `./build_and_test.sh` in Linux/Unix in the `fastsim/` dir.

### Testing
At the root level of the git repository: `pytest -v python/fastsim/tests/`. This can also be run in the python environment directly.

# Usage
To see and run examples, navigate to fastsim/docs and run the various *demo.py files to see fastsim use cases. There are other examples in fastsim/tests.
To see and run examples, navigate to `./python/fastsim/demos` and run the various *demo.py files to see fastsim use cases. There are other examples in fastsim/tests.


# Adding FASTSim as a Depency in Rust
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion python/fastsim/tests/test_cav_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_that_demo_runs_without_error(self):
is_interactive_key = 'FASTSIM_DEMO_IS_INTERACTIVE'
original_value = os.getenv(is_interactive_key)
os.environ[is_interactive_key] = 'False'
from fastsim.docs.cav_demo import RAN_SUCCESSFULLY
from fastsim.demos.cav_demo import RAN_SUCCESSFULLY
if original_value is not None:
os.environ[is_interactive_key] = original_value
else:
Expand Down
4 changes: 2 additions & 2 deletions python/fastsim/tests/test_cav_sweep.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
Test fastsim/docs/cav_sweep.py for regressions
Test fastsim/demos/cav_sweep.py for regressions
"""
import unittest
import os
import csv
from pathlib import Path

from fastsim.docs.cav_sweep import main, CSV_KEYS
from fastsim.demos.cav_sweep import main, CSV_KEYS
import fastsim as fsim

THIS_DIR = os.path.abspath(os.path.dirname(__file__))
Expand Down
2 changes: 1 addition & 1 deletion python/fastsim/tests/test_demo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tests the code from fastsim/docs/demo.py
Tests the code from fastsim/demos/demo.py
"""
import unittest
import pytest
Expand Down