From 0c8a548a2973ac67c18c43d9a5e2442446cfebc9 Mon Sep 17 00:00:00 2001 From: Christof Date: Tue, 26 Dec 2023 17:40:17 +0100 Subject: [PATCH 1/2] ENH: remove pint dependency --- .github/envs/39-latest-conda-forge.yaml | 1 - README.md | 1 - docs/conf.py | 1 - docs/environment.yml | 1 - environment-dev.yml | 1 - environment.yml | 1 - requirements-dev.txt | 1 - requirements.txt | 1 - setup.py | 2 -- trackintel/visualization/plotting.py | 9 ++------- 10 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/envs/39-latest-conda-forge.yaml b/.github/envs/39-latest-conda-forge.yaml index 3be8e80d..470814d2 100644 --- a/.github/envs/39-latest-conda-forge.yaml +++ b/.github/envs/39-latest-conda-forge.yaml @@ -8,7 +8,6 @@ dependencies: - geopandas>=0.12.0 - scikit-learn - networkx -- pint - pip - geoalchemy2 - osmnx diff --git a/README.md b/README.md index 76de4e83..dd0a652b 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,6 @@ ti.print_version() * Numpy * GeoPandas * Matplotlib -* Pint * NetworkX * GeoAlchemy2 * scikit-learn diff --git a/docs/conf.py b/docs/conf.py index 3a8d2385..59d948e8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,6 @@ "shapely.ops", "sklearn", "sklearn.neighbors", - "pint", "networkx", "networkx.exception", "osmnx", diff --git a/docs/environment.yml b/docs/environment.yml index 99a38bd4..a48963c9 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -11,7 +11,6 @@ dependencies: - pandas - scikit-learn - networkx - - pint - geoalchemy2 - osmnx - psycopg2 diff --git a/environment-dev.yml b/environment-dev.yml index 03531059..07196be7 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -9,7 +9,6 @@ dependencies: - geopandas>=0.12.0 - scikit-learn - networkx -- pint - pip - geoalchemy2 - osmnx diff --git a/environment.yml b/environment.yml index 1a3cd5c5..e32a9cfd 100644 --- a/environment.yml +++ b/environment.yml @@ -9,7 +9,6 @@ dependencies: - geopandas>=0.12.0 - scikit-learn - networkx -- pint - pip - geoalchemy2 - osmnx diff --git a/requirements-dev.txt b/requirements-dev.txt index 5e81a7f6..fd04155d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,6 @@ matplotlib geopandas>=0.12.0 scikit-learn networkx -pint geoalchemy2 osmnx psycopg2 diff --git a/requirements.txt b/requirements.txt index 5baf4717..adb11b96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ matplotlib geopandas>=0.12.0 scikit-learn networkx -pint geoalchemy2 osmnx psycopg2 diff --git a/setup.py b/setup.py index 945114a1..4461a3cc 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ "geopandas>=0.12.0", "matplotlib", "numpy", - "pint", "shapely", "networkx", "geoalchemy2", @@ -39,7 +38,6 @@ "pandas", "matplotlib", "numpy", - "pint", "shapely", "networkx", "geoalchemy2", diff --git a/trackintel/visualization/plotting.py b/trackintel/visualization/plotting.py index a449a380..f7a02a26 100644 --- a/trackintel/visualization/plotting.py +++ b/trackintel/visualization/plotting.py @@ -9,7 +9,6 @@ from matplotlib.collections import LineCollection from networkx.exception import NetworkXPointlessConcept from pandas.api.types import is_datetime64_any_dtype -from pint import UnitRegistry from trackintel.geogr import check_gdf_planar, meters_to_decimal_degrees @@ -55,14 +54,10 @@ def a4_figsize(fig_height_mm=None, columns=2): logging.warning(f"fig_height too large: {fig_height_mm}, so will reduce to {max_figh_height_mm}.") fig_height_mm = max_figh_height_mm - ureg = UnitRegistry() - fig_height_mm *= ureg.millimeter - fig_width_mm *= ureg.millimeter - fig_width = fig_width_mm.to(ureg.inch).magnitude - fig_height = fig_height_mm.to(ureg.inch).magnitude + inch = 1/25.4 # millimeter in inches logging.info(f"Creating figure of {fig_width_mm}x{fig_height_mm}.") - return fig_width, fig_height + return fig_width_mm * inch, fig_height_mm * inch def regular_figure(): From 4782051cd2f805d86c2017df879115af5124bef1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:43:02 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- trackintel/visualization/plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trackintel/visualization/plotting.py b/trackintel/visualization/plotting.py index f7a02a26..4dc3d719 100644 --- a/trackintel/visualization/plotting.py +++ b/trackintel/visualization/plotting.py @@ -54,7 +54,7 @@ def a4_figsize(fig_height_mm=None, columns=2): logging.warning(f"fig_height too large: {fig_height_mm}, so will reduce to {max_figh_height_mm}.") fig_height_mm = max_figh_height_mm - inch = 1/25.4 # millimeter in inches + inch = 1 / 25.4 # millimeter in inches logging.info(f"Creating figure of {fig_width_mm}x{fig_height_mm}.") return fig_width_mm * inch, fig_height_mm * inch