Skip to main content

Mechaphlowers

PyPI Latest Release MPL-2.0 License versions Documentation Actions Status

Quality Gate Status Coverage

Numpy pyodide lite-badge

Physical calculation package for the mechanics and geometry of overhead power lines.

User

Environment

Mechaphlowers is using uv for project, python version and dependencies management. You can use uv which is very similar to pip. You can also use other tools compatible with pip.

See uv documentation to install it.

You need a compatible python version. You may have to install it manually (e.g. with pyenv). Then you may create a virtualenv, install dependencies and activate the env:

    uv venv --python 3.11
    source .venv/bin/activate

!!! Tip

You would probably use an editor, make sure you configure it to use the same virtual environment you created (it will probably autodetect it) so that you can get autocompletion and inline errors. Here some links for [VSCode](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment) and [PyCharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html).  

Set up mechaphlowers

Install the package.

    uv pip install mechaphlowers

Use it ! You can report to the user guide section or go to our tutorials notebook jupyter server to try it.

    import mechaphlowers as mph
    print(mph.__version__)

Developers

Environment

You need to install the project with all the development and documentation packages:

    uv venv --python 3.11
    source .venv/bin/activate
    uv sync --group all

Checks and rules

Format and linter

Once dev dependencies are installed, you may format and lint python files like this:

    uv run ruff format
    uv run ruff check

Use following command if you only want to check if files are correctly formatted:

    uv run ruff format --check

You may automatically fix some linting errors:

    uv run ruff check --fix

Tip: if using VSCode/VSCodium, you may also use Ruff extension.

How to check typing

In order to check type hints consistency, you may run:

    uv run mypy .

How to test

    uv run coverage run -m pytest
    uv run coverage report

Run all checks in one

A Makefile provide a fast access to those different checks.
You may run every check mentioned above with just one command:

    make all

Requirements

Lock file

The generation of the lock file is important.
Do not forget to update it with:

    uv lock
    uv lock --check # to check if changes have been done

Installation from lock file only

When syncing, uv can update the lock file. But it can be an unwanted behavior. In this case use:

    uv sync --frozen --group all

Pip compatibility

Requirements can be extracted with pip compile. See here for more information.

Build the library

Framework

We are using the pdm backend to build the package.

Version

The versioning is linked with the tag. To build a local version, you can add a tag, build version and then delete tag.
The tag is expected to have the following form: v0.1.2 and support alpha and beta version v0.1.2a0.

    git tag  v0.2.0b1
    uv build # --> dist/mechaphlowers-0.2.0b1-...whl
    git tag -d v0.2.0b1

The variable PACKAGE_BUILD_TEST can be used to add the .devXversion.

    git tag  v0.2.0b1
    export PACKAGE_BUILD_TEST=3
    uv build # --> dist/mechaphlowers-0.2.0b1.dev3-...whl
    git tag -d v0.2.0b1

Build

In order to build the library (wheel and tar.gz archive):

    uv build

You can check the build option to control the output folder or the desired output file types.

How to serve the documentation

You can build and serve the documentation using or make docs:

    uv run --only-group docs mkdocs serve -a localhost:8001

Testing in a browser via pyodide

You may test your pyodide package using pyodide console in a browser.

Download pyodide

Check available versions of Pyodide on the releases page. To work with stellar you may wnat to download this one: https://github.com/pyodide/pyodide/releases/download/0.28.3/pyodide-0.28.3.tar.bz2. Then, extract it and serve it with a web server:

tar -xvf pyodide-0.28.3.tar.bz2
cd pyodide
python3 -m http.server

Pyodide console is then available at http://localhost:8000/console.html

Test in pyodide console

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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mechaphlowers-0.11.1.tar.gz (173.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mechaphlowers-0.11.1-py3-none-any.whl (207.9 kB view details)

Uploaded Python 3

File details

Details for the file mechaphlowers-0.11.1.tar.gz.

File metadata

  • Download URL: mechaphlowers-0.11.1.tar.gz
  • Upload date:
  • Size: 173.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mechaphlowers-0.11.1.tar.gz
Algorithm Hash digest
SHA256 61f3727ce277e113f60eba67c55ea63d290b46b61f11074c18c7e46f2ddf0ce8
MD5 cf4e78978d11ae4bca201fde83a8f1fd
BLAKE2b-256 c7b12cf5d293748d39e43a2c049624d4a8b2a5144f2805adaebb2644640d543e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mechaphlowers-0.11.1.tar.gz:

Publisher: publish.yml on phlowers/mechaphlowers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mechaphlowers-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: mechaphlowers-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 207.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mechaphlowers-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4ce0c5bbbd9d5816a5a7bab6e0129824cd4524423ccdfe97384de054c1c531f
MD5 204d925ba90411d64498b3c63383b4de
BLAKE2b-256 c400a7bc9102f214241ffb7e1e602e0fbd58eb6f137f239c90b9151f6a2c3ecc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mechaphlowers-0.11.1-py3-none-any.whl:

Publisher: publish.yml on phlowers/mechaphlowers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page