Skip to content

Commit

Permalink
Merge pull request #455 from OpenDataServices/445-geo-dep-docs
Browse files Browse the repository at this point in the history
geo: Add example pip install command to geo warning
  • Loading branch information
Bjwebb authored Aug 8, 2024
2 parents 537d72e + 95d5de4 commit ac26eaa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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
5 changes: 4 additions & 1 deletion flattentool/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
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 +151,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 ac26eaa

Please sign in to comment.