https://github.com/flexcompute/flow360
https://github.com/flexcompute/flow360
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/flexcompute/flow360
- Owner: flexcompute
- License: lgpl-2.1
- Created: 2022-08-22T09:05:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2026-02-04T21:26:24.000Z (5 months ago)
- Last Synced: 2026-02-05T01:48:06.713Z (5 months ago)
- Language: Python
- Size: 42 MB
- Stars: 20
- Watchers: 6
- Forks: 9
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flow360


[](https://pypi.python.org/pypi/flow360/)

# How to use Flow360 python client
## install
### Using pip (recommended)
``pip install flow360``
### install pre-release version
``pip install -U flow360 --pre``
## client config api-key
Get your *api-key* from [flow360.simulation.cloud](https://flow360.simulation.cloud)

You can set your *api-key* by ONE of the following methods:
1. Set globaly for your acount: ``flow360 configure`` will store *api-key* in ~/.flow360
2. In shell:
* Bash/Zsh shell (Linux or Mac): ``export FLOW360_APIKEY="my api-key"``
* Powershell (Windows): ``$Env:FLOW360_APIKEY="my api-key"``
3. In python script: ``os.environ["FLOW360_APIKEY"] = "my api-key"`` before or after `import flow360`
---
**NOTE**
Environment ``FLOW360_APIKEY`` variable takes precedence before Flow360 configure file generated by ``flow360 configure``
---
## run examples:
1. Get examples from this repository:
1. ``git clone https://github.com/flexcompute/Flow360.git``
2. ``cd Flow360/examples``
2. run ``python case_results.py``
# Development
## setup
0. clone repo
1. Install poetry ``pip install poetry``
2. ``poetry env activate`` gives you the command to activate the virtual environment, copy paste and run the command to enter the virtual environment. Or you can just prepend `poetry run` on all the python related commands.
3. Install dependencies: ``poetry install``
## run examples
- ``python examples/case_results.py``
- You can also run examples without activating shell:
``poetry run python examples/case_results.py``
## check in
1. ``black .`` - performs auto-formatting
2. ``isort .`` - sorts imports
3. ``poetry run pylint $(git ls-files "flow360/*.py") --rcfile .pylintrc`` - checks code style
4. ``poetry run pytest -rA tests/simulation`` - run V2 related tests
5. ``poetry run pytest -rA --ignore tests/simulation`` - run V1 related tests (cannot be run altogether)
6. ``pytest -rA tests/simulation --cov-report=html --cov=flow360/component/simulation`` - see test coverage report for V2 client
7. ``pytest -rA --ignore tests/simulation --cov-report=html --cov=flow360 && open htmlcov/index.html`` - see test coverage report for V1+V2 client
## Documentation Requirements
If you want to install the requirements to locally build the documentation you can run:
```bash
poetry install -E docs
```
Alternatively, you can also install the extra in any pip-controlled venv:
```bash
pip install -e .[docs]
```