Skip to content

Commit

Permalink
Merge pull request #206 from PyFixate/move-examples
Browse files Browse the repository at this point in the history
Move examples out of the package and update readme
  • Loading branch information
clint-lawrence authored Aug 1, 2024
2 parents d54dd19 + 8e17155 commit ccac2c2
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 35 deletions.
46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ While Fixate is fairly simple, it is already being used to test real electronics

## Getting Started

Fixate runs on Python 3.7 or greater.
Fixate runs on Python 3.8 or greater.

### Installing

Expand All @@ -19,48 +19,40 @@ Alternatively, install from Pypi with 'pip install fixate'

### Run the example scripts

There are a number of examples under src/fixate/examples. For a minimal example try running tiny.py.
There are a number of examples under the examples folder.
You will need a clone fo the git repository to get the examples.
For a minimal example try running tiny.py.
For a more complicated example using multi-level tests, try running multi_level_design.py.
The test runner is executed by calling the package as a script with the test script to execute passed in using the
'-p' command line argument, as well as the -c command line argument to specify the config file
The test runner is executed by calling the `fixate` package and passing in the test script to execute using the '-p' command line argument.

#### Running on Windows:
The following commands are for Windows:

If running from a pip installed version of fixate the path to the examples will be "path_to_python_installation"/Lib/site-packages/fixate/examples/ From this folder the following can be executed:

python -m fixate -p tiny.py

Alternatively the full path to tiny.py can be provided.

python -m fixate -p "path_to_python_installation"/Lib/site-packages/fixate/examples/tiny.py

#### Running on MacOS:

Running on Mac is the same as running on Windows with the exception of the path to the examples. The path will be: "path_to_python_installation"/lib/pythonX.Y/site-packages/fixate/examples/
Where X.Y is the version of python that is installed.
```sh
git clone https://github.com/PyFixate/Fixate.git
cd Fixate
py -m venv .venv
.venv\Scripts\activate
py -m pip install .
py -m fixate -p examples\tiny.py
```

#### Running during development

For easier development, test scripts can be setup to call the fixate main as their own
with some default parameters, as in:

python -m fixate.examples.tiny
python examples/tiny.py

Using that `__main__` example in your own test script then means you can run it as:

python -m my_test_script

## Running the tests
In general, it is recommended to run the "core" set of tests.
The "drivers" test have a number of dependencies that are not required by default. Tests run using unittest.
Navigate to the test/core directory and execute "python -m unittest".

## Modifying the Qt GUI

The Qt GUI base file is created using Qt Designer under Mingw32.
If you'd like to make changes, use pyuic5 to build the layout file, with the command:

pyuic5 fixateGUI.ui -o layout.py
The "drivers" test have a number of dependencies that are not required by default.
Tests are run using pytest.
The easiest way to run the test is using tox.
To run the tests manually using pytest, excluding tests that required instruments, you can run `pytest -m "not drivertest"`.


## Check out the docs
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.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ exclude = (?x)
|__init__.py
|ftdi.py
)
|examples/
(
function_generator.py
|programmable_power_supply.py
|test_script.py
)
)
)
warn_unused_configs = True
Expand All @@ -89,5 +83,3 @@ follow_imports = silent
follow_imports = silent
[mypy-fixate.drivers,fixate.drivers.dso.helper,fixate.drivers.funcgen.helper,fixate.drivers.funcgen.rigol_dg1022,fixate.drivers.pps,fixate.drivers.pps.helper,fixate.drivers.ftdi]
follow_imports = silent
[mypy-fixate.examples.function_generator,fixate.examples.programmable_power_supply,fixate.examples.test_script]
follow_imports = silent

0 comments on commit ccac2c2

Please sign in to comment.