Physical calculation package for the mechanics and geometry of overhead power lines.
You need python 3.11. You may have to install it manually (e.g. with pyenv).
Then you may create a virtualenv, install dependencies and activate the env:
# create virtual env (if needed) and install dependencies (including dev dependencies)
poetry install
poetry shell # activate virtual env
Tip: if using VSCode/VSCodium, configure it to use your virtual env's interpreter.
Once dev dependencies are installed, you may format and lint python files like this:
poetry run poe format
poetry run poe lint
Use following command if you only want to check if files are correctly formatted:
poetry run poe check-format
You may automatically fix some linting errors:
poetry run poe lint-fix
Tip: if using VSCode/VSCodium, you may also use Ruff extension.
In order to check type hints consistency, you may run:
poetry run poe typing
poetry run poe test
Configure VSCode to use your virtual env's interpreter. Open the Testing tab and configure tests using pytest. Click to run tests.
You may run every check mentioned above with just one command:
poetry run poe checks
In order to build the library (wheel and tar.gz archive):
poetry build
poetry install --with docs # install documentation related dependencies
poetry run poe doc
You may test your pyodide package using pyodide console in a browser.
Download a version of Pyodide from the releases page, extract it and serve it with a web server:
wget https://github.com/pyodide/pyodide/releases/download/0.25.0/pyodide-0.25.0.tar.bz2
tar -xvf pyodide-0.25.0.tar.bz2
cd pyodide
python3 -m http.server
Pyodide console is then available at http://localhost:8000/console.html
Copy needed wheels to pyodide folder. Then, in pyodide console:
import micropip
# load your wheel
await micropip.install("http://localhost:8000/<wheel_name>.whl", keep_going=True)