Skip to content

Commit

Permalink
Updates to READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bauer committed Dec 26, 2024
1 parent 7f895e7 commit 300d428
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 38 deletions.
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,12 @@ for i in 0..10 {
// z = 70.00000 km p = 21.51808 Pa
```

## Python Package

For information on how to install, use and build the Python package, see [here](si-units).

## Documentation

For the rust documentation, see [here](https://docs.rs/quantity).

For the python documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).

## Development

To build the project including the bindings to python, we use [maturin](https://github.com/PyO3/maturin).

When developing, use

```
maturin develop --release
```

To build the python wheels, use

```
maturin build --release
```

To build the documentation you need `sphinx` and some additional packages. From the root directory, type

```
cd si-units/docs
make html
```

To run the doctests, from the root directory, type

```
cd si-units/docs
make doctest
```
50 changes: 42 additions & 8 deletions si-units/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ In addition to simple scalar quantities, it can be used to decorate any complex

## Installation and Usage

You can install the python package from source (you need a rust compiler for that):
You can install the package from PyPI

```
pip install git+https://github.com/itt-ustutt/quantity
pip install si-units
```

or get the compiled files from PyPI
For the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).

```
pip install si-units
```
To build the wheel or documentation locally, see below.

## Examples

Expand All @@ -45,6 +43,42 @@ sqms = ms**2
print(sqms) # [4, 9, 16] m²
```

## Documentation
## Building from Source

You need a rust compiler to build the wheel locally.
To build the bindings to python, we use [maturin](https://github.com/PyO3/maturin).

Use

``` bash
# in si-units
maturin develop --release
```

to build the package locally.

To build the python wheels, use

```bash
maturin build --release
```

## Building the Documentation

To build the documentation you need `mkdocs-material` and `mkdocstrings-python`. Installing these packages (e.g. using `uv` or `pip`) will also install the needed dependencies.
During development, use

```bash
# in si-units
mkdocs serve
```

to run a local development server.

To build the documentation for deployment, use

```bash
# in si-units
mkdocs build
```

For the documentation, see [here](https://itt-ustutt.github.io/quantity/index.html).

0 comments on commit 300d428

Please sign in to comment.