Skip to content

Commit

Permalink
ENH: remove pint dependency (#591)
Browse files Browse the repository at this point in the history
* ENH: remove pint dependency

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
bifbof and pre-commit-ci[bot] authored Dec 26, 2023
1 parent 9a6363c commit e98354d
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/envs/39-latest-conda-forge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies:
- geopandas>=0.12.0
- scikit-learn
- networkx
- pint
- pip
- geoalchemy2
- osmnx
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ ti.print_version()
* Numpy
* GeoPandas
* Matplotlib
* Pint
* NetworkX
* GeoAlchemy2
* scikit-learn
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"shapely.ops",
"sklearn",
"sklearn.neighbors",
"pint",
"networkx",
"networkx.exception",
"osmnx",
Expand Down
1 change: 0 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- pandas
- scikit-learn
- networkx
- pint
- geoalchemy2
- osmnx
- psycopg2
Expand Down
1 change: 0 additions & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- geopandas>=0.12.0
- scikit-learn
- networkx
- pint
- pip
- geoalchemy2
- osmnx
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- geopandas>=0.12.0
- scikit-learn
- networkx
- pint
- pip
- geoalchemy2
- osmnx
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ matplotlib
geopandas>=0.12.0
scikit-learn
networkx
pint
geoalchemy2
osmnx
psycopg2
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ matplotlib
geopandas>=0.12.0
scikit-learn
networkx
pint
geoalchemy2
osmnx
psycopg2
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"geopandas>=0.12.0",
"matplotlib",
"numpy",
"pint",
"shapely",
"networkx",
"geoalchemy2",
Expand All @@ -39,7 +38,6 @@
"pandas",
"matplotlib",
"numpy",
"pint",
"shapely",
"networkx",
"geoalchemy2",
Expand Down
9 changes: 2 additions & 7 deletions trackintel/visualization/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit e98354d

Please sign in to comment.