Skip to content

Commit

Permalink
Issue/optional geopandas (#141)
Browse files Browse the repository at this point in the history
* optional geopandas

* lint

* dont raise error

* more wrapper around imports

* lint
  • Loading branch information
peterdudfield authored Jun 3, 2024
1 parent 02ed39e commit 4ff5bcc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pvsite_datamodel/write/data/dno.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
import logging
import os

from shapely.geometry import Point

from pvsite_datamodel.write.data.utils import lat_lon_to_osgb

try:
import geopandas as gpd
from shapely.geometry import Point
except ImportError:
print("You might want to install geopandas") # noqa

Expand Down
2 changes: 1 addition & 1 deletion pvsite_datamodel/write/data/gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import os

import pandas as pd
from shapely.geometry import Point

from pvsite_datamodel.write.data.utils import lat_lon_to_osgb

try:
import geopandas as gpd
from shapely.geometry import Point
except ImportError:
print("You might want to install geopandas") # noqa

Expand Down
5 changes: 4 additions & 1 deletion pvsite_datamodel/write/data/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
""" Utils for GSP and DNO. """

import pyproj
try:
import pyproj
except ImportError:
print("You might want to install pyproj") # noqa

# OSGB is also called "OSGB 1936 / British National Grid -- United
# Kingdom Ordnance Survey". OSGB is used in many UK electricity
Expand Down

0 comments on commit 4ff5bcc

Please sign in to comment.