Metadata-Version: 2.4
Name: cubitpy
Version: 0.0.1
Summary: CubitPy: Utility functions and 4C related functionality for the Cubit and Coreform python interface
Author-email: Ivo Steinbrecher <ivo.steinbrecher@unibw.de>
License-Expression: MIT
Project-URL: Repository, https://github.com/imcs-compsim/cubitpy/
Project-URL: Issues, https://github.com/imcs-compsim/cubitpy/issues/
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: execnet==1.9.0
Requires-Dist: netCDF4
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: coverage; extra == "dev"
Requires-Dist: coverage-badge; extra == "dev"
Requires-Dist: setuptools; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

[![build-test](https://github.com/imcs-compsim/cubitpy/actions/workflows/.github/workflows/build-test.yml/badge.svg)](https://github.com/imcs-compsim/cubitpy/actions/workflows/.github/workflows/build-test.yml)

# CubitPy

Utility functions and 4C related functionality for the Cubit and Coreform python interface,
Especially for the creation of input files for 4C.

## Usage

A tutorial can be found in the `/tutorial` directory.

## Contributing

If you are interested in contributing to CubitPy, we welcome your collaboration.
For general questions, feature request and bug reports please open an [issue](https://github.com/imcs-compsim/cubitpy/issues).

If you contribute actual code, fork the repository and make the changes in a feature branch.
Depending on the topic and amount of changes you also might want to open an [issue](https://github.com/imcs-compsim/cubitpy/issues).
To merge your changes into the CubitPy repository, create a pull request to the `main` branch.
A few things to keep in mind:
- It is highly encouraged to add tests covering the functionality of your changes, see the test suite in `tests/`.
- CubitPy uses `black` to format python code.
  Make sure to apply `black` to the changed source files.
- Feel free to add yourself to the [CONTRIBUTORS](CONTRIBUTORS) file.

## Installation

CubitPy is developed with `python3.12`.
Other versions of Python might lead to issues.
It is recommended to use a python environment container such as `conda` or `venv`.
- `conda`:
  A [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) environment can be created and loaded with
  ```bash
  conda create -n cubitpy python=3.12
  conda activate cubitpy
  ```
- `venv`: Chose an appropriate directory for this, e.g., `/home/user/opt`.
  A virtual environment can be setup with
  - On Debian systems the following packages have to be installed:
    ```bash
    sudo apt-get install python3-venv python3-dev
    ```
  - Create and load the environment
    ```bash
    cd <path-to-env-folder>
    python -m venv cubitpy-env
    source cubitpy-env/bin/activate
    ```

To install `cubitpy` go to the repository root directory
```bash
cd path_to_cubitpy
```

And install `cubitpy` via `pip`
```bash
pip install .
```

If you intend to actively develop `cubitpy`, install it in *editable mode*
```bash
pip install -e .
```

To run CubitPy it is required to set an environment variable with the path to the Cubit directory. This should be the "root" directory for the installation.
```bash
export CUBIT_ROOT=path_to_cubit_root_directory
```

To check if everything worked as expected, run the tests from within the `tests` directory
```bash
cd path_to_cubitpy/tests
pytest -q testing.py
```

If you intend to actively develop CubitPy, please make sure to install the `pre-commit` hook within the python environment to follow our style guides:
```bash
pre-commit install
```
