Skip to content

Commit

Permalink
geo: Add example pip install command to geo warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Aug 1, 2024
1 parent 1b00770 commit 2e6e4ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- Use custom warnings and exceptions [#450](https://github.com/OpenDataServices/flatten-tool/issues/450) [#451](https://github.com/OpenDataServices/flatten-tool/issues/451)
- Add example pip install command to geo dependencies missing warning [#445](https://github.com/OpenDataServices/flatten-tool/issues/445)

## [0.25.0] - 2024-07-05

Expand Down
7 changes: 6 additions & 1 deletion flattentool/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
from zipfile import BadZipfile as BadZipFile


GEO_DEPENDENCIES_MESSAGE = (
"Install flattentool's optional geo dependencies to use geo features, for example pip install flattentool[geo]"
)


class Cell:
def __init__(self, cell_value, cell_location):
self.cell_value = cell_value
Expand Down Expand Up @@ -148,7 +153,7 @@ def convert_type(type_string, value, timezone=pytz.timezone("UTC"), convert_flag
return feature.geometry
else:
warn(
"Install flattentool's optional geo dependencies to use geo features.",
GEO_DEPENDENCIES_MESSAGE,
FlattenToolWarning,
)
return str(value)
Expand Down
4 changes: 2 additions & 2 deletions flattentool/json_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
FlattenToolWarning,
)
from flattentool.i18n import _
from flattentool.input import path_search
from flattentool.input import GEO_DEPENDENCIES_MESSAGE, path_search
from flattentool.schema import make_sub_sheet_name
from flattentool.sheet import PersistentSheet

Expand Down Expand Up @@ -404,7 +404,7 @@ def parse_json_dict(
skip_type_and_coordinates = True
else:
warn(
"Install flattentool's optional geo dependencies to use geo features.",
GEO_DEPENDENCIES_MESSAGE,
FlattenToolWarning,
)

Expand Down

0 comments on commit 2e6e4ff

Please sign in to comment.