Skip to content

Commit

Permalink
!refactor: rename package to GeoProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Apr 29, 2024
1 parent d3ac03c commit 1357484
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 115 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/release.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# other
*.png
*.html
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# GeoProfileCore
# GeoProfile

[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

Explore the depths of the Earth with GeoProfileCore, a comprehensive package designed for geotechnical professionals and
Explore the depths of the Earth with GeoProfile, a comprehensive package designed for geotechnical professionals and
researchers. This versatile toolkit is your go-to resource for analyzing and visualizing geotechnical profiles, offering
a seamless experience in understanding the complex stratigraphy of the subsurface.

Whether you are involved in civil engineering, environmental science, or geotechnical exploration, GeoProfileCore is your
Whether you are involved in civil engineering, environmental science, or geotechnical exploration, GeoProfile is your
indispensable companion for unraveling the mysteries beneath the surface. Elevate your geotechnical analysis and make
informed decisions with GeoProfileCore – where geology meets technology.
informed decisions with GeoProfile – where geology meets technology.

# Installation

To install this package, including the `map` and `gef` reading functionality, run:

```bash
pip install geoprofilecore[map, gef]
pip install geoprofile[map, gef]
```

To skip the installation of the `GeoProfileCore` library, in case you do not need it (e.g. only use pure plotting), run:
To skip the installation of the `GeoProfile` library, in case you do not need it (e.g. only use pure plotting), run:

```bash
pip install geoprofilecore
pip install geoprofile
```

# Contribution
Expand Down Expand Up @@ -62,8 +62,8 @@ You can get your token at: `https://cemsbv.crux-nuclei.com`
We format our code with black and isort.

```bash
black --config "pyproject.toml" src/geoprofilecore tests notebook docs
isort --settings-path "pyproject.toml" src/geoprofilecore tests notebook docs
black --config "pyproject.toml" src/geoprofile tests notebook docs
isort --settings-path "pyproject.toml" src/geoprofile tests notebook docs
```

## Lint
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
os.environ["DOC_PATH"] = os.path.dirname(__file__)


project = "GeoProfileCore"
project = "GeoProfile"
copyright = "2024, CEMS BV"
author = "CEMS"

# The full version, including alpha/beta/rc tags
import geoprofilecore # noqa: E402 F403 F401
import geoprofile # noqa: E402 F403 F401

release = geoprofilecore.__version__
release = geoprofile.__version__

# 'sphinx.ext.napoleon' Used for numpy docstring support
extensions = [
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Welcome to GeoProfileCore's documentation!
Welcome to GeoProfile's documentation!
============================================

Indices and tables
Expand Down
16 changes: 8 additions & 8 deletions docs/tree/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
Getting started
===============

The easiest way to get started with GeoProfileCore is in the **Jupyter Notebook**.
The easiest way to get started with GeoProfile is in the **Jupyter Notebook**.

Installation
------------
To install this package, including the `map` and `gef` reading functionality, run:

.. code-block::
pip install geoprofilecore[map, gef]
pip install geoprofile[map, gef]
To skip the installation of the `GeoProfileCore` library, in case you do not need it (e.g. only use pure plotting), run:
To skip the installation of the `GeoProfile` library, in case you do not need it (e.g. only use pure plotting), run:

.. code-block::
pip install geoprofilecore
pip install geoprofile
Than you can import proficore as follows:

.. ipython:: python
from geoprofilecore.column import Column
from geoprofilecore.profile import Section
from geoprofile.column import Column
from geoprofile.profile import Section
import numpy as np
import plotly.io as pio
Expand All @@ -36,7 +36,7 @@ Create Columns
---------------

The first thing to do is to create column classes. This class holds the information of the for
example a CPT or borehole. For more information on the :func:`geoprofilecore.column.Column` class go
example a CPT or borehole. For more information on the :func:`geoprofile.column.Column` class go
the the reference.


Expand Down Expand Up @@ -174,7 +174,7 @@ Create Profile
----------------

The next step is to create a Section class. This class holds the information of all Columns.
For more information on the :func:`geoprofilecore.column.Section` class go
For more information on the :func:`geoprofile.column.Section` class go
the the reference.

.. ipython:: python
Expand Down
4 changes: 2 additions & 2 deletions docs/tree/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Reference

Column
------
.. autoclass:: geoprofilecore.column.Column
.. autoclass:: geoprofile.column.Column
:members:
:inherited-members:

.. automethod:: __init__

CrossSection
-------------
.. autoclass:: geoprofilecore.profile.Section
.. autoclass:: geoprofile.profile.Section
:members:
:inherited-members:

Expand Down
23 changes: 13 additions & 10 deletions notebook/Nxxxxx.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import io

import matplotlib.pyplot as plt
import plotly
import plotly.io as pio
import pygef
from nuclei.client import NucleiClient
from shapely.geometry import LineString
from tqdm import tqdm

from geoprofilecore import Column, Section
from geoprofile import Column, Section

pio.renderers.default = "browser"

Expand All @@ -31,8 +32,8 @@

# ** classify_metode:
# Metode used to classify CPT data.
# Accepted values: ["beenJefferies", "machineLearning", "nen", "table", "robertson", "table"]
classify_metode = "robertson"
# Accepted values: ["beenJefferies", "machineLearning", "nen", "table", "robertson", "ntype"]
classify_metode = "ntype"

# Get CPTs
# loop over the cpt id's and fetch file from BRO
Expand Down Expand Up @@ -94,22 +95,24 @@
)

# create a map of the line and CPT's
profile.plot_map(add_basemap=False, add_tags=True, debug=True)
axis = profile.plot_map(add_basemap=True, add_tags=True, debug=False)
plt.savefig("map.png")

# create a profile
fig = profile.plot(
plot_kwargs={
"coneResistance": {"line_color": "black"},
"localFriction": {"line_color": "red", "factor": 10},
"coneResistance": {"line_color": "black", "factor": 2},
"frictionRatioComputed": {"line_color": "red", "factor": 4},
"porePressureU2": {"line_color": "blue", "factor": 100},
},
hue="uniform",
fillpattern=False,
surface_level=True,
groundwater_level=True,
surface_level=False,
groundwater_level=False,
)
# html file
_ = plotly.offline.plot(fig, filename=project_number + " " + project_name + ".html")

# png file
fig.update_layout(showlegend=False)
# fig.write_image("profile_A2.png", width=1900, height=937)
# fig.update_layout(showlegend=False)
fig.write_image("profile_A2.png", width=1900, height=937)
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "GeoProfileCore"
name = "GeoProfile"
version = "0.1.0"
description = "A Python library for visualizing geotechnical profiles."
dependencies = [
Expand All @@ -20,7 +20,7 @@ readme = "README.md"
keywords = ["visualizing"]

[project.urls]
repository = "https://github.com/cemsbv/GeoProfileCore"
repository = "https://github.com/cemsbv/GeoProfile"

[project.optional-dependencies]
map = [
Expand Down Expand Up @@ -53,7 +53,7 @@ ensure_newline_before_comments = true
line_length = 88

[tool.mypy]
files = ["geoprofilecore"]
files = ["geoprofile"]
mypy_path = 'src'
namespace_packages = true
show_error_codes = true
Expand Down
6 changes: 6 additions & 0 deletions src/geoprofile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from geoprofile.column import Column
from geoprofile.profile import Section

from ._version import __version__

__all__ = ["__version__", "Column", "Section"]
File renamed without changes.
2 changes: 1 addition & 1 deletion src/geoprofilecore/column.py → src/geoprofile/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from plotly.graph_objects import Figure
from plotly.subplots import make_subplots

from geoprofilecore.constant import CODING_SOIL_TYPES
from geoprofile.constant import CODING_SOIL_TYPES

# optional import
try:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from skspatial.objects import Line
from tqdm import tqdm

from geoprofilecore.column import Column
from geoprofile.column import Column

# optional imports
try:
Expand Down
6 changes: 0 additions & 6 deletions src/geoprofilecore/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_column.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from plotly.graph_objs import Figure

from geoprofilecore import Column
from geoprofile import Column


def test_column_plot(classify_dict: dict, data_dict: dict) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import plotly.graph_objs as go
from shapely.geometry import LineString

from geoprofilecore import Column, Section
from geoprofile import Column, Section


def test_sorting(classify_dict: dict) -> None:
Expand Down

0 comments on commit 1357484

Please sign in to comment.