Skip to content

refactor(plot)!: put [plot] behind a feature flag #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@
[![GitHub stars](https://img.shields.io/github/stars/ritchie46/pygef.svg?logo=github&label=Stars&logoColor=white)](https://github.com/ritchie46/pygef)
[![Coverage Status](https://coveralls.io/repos/github/cemsbv/pygef/badge.svg?branch=master)](https://coveralls.io/github/cemsbv/pygef?branch=master)

Simple parser for \*.gef files. These are ASCII based files used for soil properties measurements.
Compatible with Python 3.9.
Simple parser for \*.gef files. These are ASCII based files used for soil
properties measurements. Compatible with Python 3.9.

Recently added the parsing of xml boreholes file, the xml parsing is still in a preliminary phase,
not all the files are supported. If you find a file that doesn't work with pygef, please make an issue about it or PR :)
Recently added the parsing of xml boreholes file, the xml parsing is still in a
preliminary phase, not all the files are supported. If you find a file that
doesn't work with pygef, please make an issue about it or PR :)

## Installation

Latest stable version:

`$ pip install pygef`
```sh
pip install pygef
```

Cutting-edge version (might break):

`$ pip install git+https://github.com/cemsbv/pygef.git`
```sh
pip install git+https://github.com/cemsbv/pygef.git
```

## CPT files

Expand Down Expand Up @@ -116,11 +121,17 @@ tot630u ┆ 0.0, │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ ... │
│ ┆ ┆ ┆ ┆ ┆ ┆ ┆ 0.0] │
└────────────┴────────────┴────────────┴──────────┴────────────┴────────────┴────────────┴─────────┘

```

## Plotting

To use the plotting functionality pygef needs to be installed with the `[plot]`
feature.

```sh
pip install pygef[plot]
```

```python
from pygef import read_cpt, read_bore
from pygef.plotting import plot_cpt, plot_bore
Expand Down Expand Up @@ -157,7 +168,8 @@ isort --settings-path "pyproject.toml" .

To maintain code quality we use the GitHub super-linter.

To run the linters locally, run the following bash script from the root directory:
To run the linters locally, run the following bash script from the root
directory:

```bash
docker run \
Expand Down Expand Up @@ -195,11 +207,11 @@ coverage run -m pytest
Requirements are autogenerated by `pip-compile` with python 3.9

```bash
pip-compile --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml
pip-compile --extra=plot --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml
```

To update the requirements within the defined ranges, run:

```bash
pip-compile --upgrade --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml
pip-compile --upgrade --extra=plot --extra=test --extra=docs --extra=lint --extra=map --output-file=requirements.txt pyproject.toml
```
3 changes: 3 additions & 0 deletions cemsdev.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[python.env]
MODULES = "src"
EXTRA_REQUIREMENTS = "docs --extra=plot --extra=lint --extra=map --extra=test"
11 changes: 3 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ version = "0.11.0"
description = "Parse soil measurument data."
dependencies = [
"polars>=1,<2",
"matplotlib>=3.6,<4.0",
"lxml>=5,<6.0",
"gef-file-to-map>=0.2,<0.3",
]
Expand All @@ -21,6 +20,9 @@ keywords = ["gef"]
repository = "https://github.com/cemsbv/pygef"

[project.optional-dependencies]
plot = [
"matplotlib>=3.6,<4.0",
]
test = [
"coveralls",
"pytest"
Expand Down Expand Up @@ -62,13 +64,6 @@ warn_unused_ignores = true
warn_unused_configs = true
disallow_subclassing_any = true
no_implicit_optional = true
#disallow_untyped_defs = true
#strict_concatenate = true
#disallow_any_generics = true
#disallow_untyped_calls = true
#warn_return_any = true
#no_implicit_reexport = true
#strict_equality = true

[[tool.mypy.overrides]]
module = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --extra=docs --extra=lint --extra=map --extra=test --output-file=requirements.txt pyproject.toml
# uv pip compile --extra=plot --extra=docs --extra=lint --extra=map --extra=test --output-file=requirements.txt pyproject.toml
affine==2.4.0
# via rasterio
alabaster==1.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/pygef/gef/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import re
from datetime import date
from typing import Dict, List, Optional, Tuple, Union
from typing import Dict, List, Tuple, Optional, Union

import numpy as np

Expand Down
Loading
Loading