Skip to content

Commit

Permalink
Merge pull request #24 from PermafrostDiscoveryGateway/develop
Browse files Browse the repository at this point in the history
changed version 0.1.0 to version 0.9.0 for release, removed commented…
  • Loading branch information
julietcohen authored May 15, 2023
2 parents 05b50ba + 76f9a9f commit c84e8cc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The staging process will also output a summary CSV file with one row for each ti
- It is assumed that incoming vector data comprises only valid polygons. **Any non-polygon data is removed**, including multi-polygons, points, lines, or other geometries.
- It's also assumed that each incoming vector file is staged only once. If a file passes through the staging step twice, then all polygons from that file will be duplicated in the output (but with a different identifier). This is due to the fact that when a tile file already exists, additional polygons that belong to this tile will be appended to the file.
- The input data does not contain `NaN` values or infinite values, or if the data does contain one of these, then the value is known. Failing to specify this value in the configuration cause issues later in the visualization pipeline.
- For release 0.1.0, the deduplication method `neighbors` has not been thoroughly tested. The deduplication method should be `None` or `footprints`.
- For release 0.9.0, the deduplication method `neighbors` has not been thoroughly tested. The deduplication method should be `None` or `footprints`.
- If the deduplication method specified in the configuration is `footprints`, the footprint file(s) are provided with a structure that follows the [docs](https://github.com/PermafrostDiscoveryGateway/viz-staging/blob/main/docs/footprints.md).
- In order for logging to work properly, the node running the script that uses this package has a `/tmp` directory so the `log.log` file can populate there.

10 changes: 5 additions & 5 deletions pdgstaging/ConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class ConfigManager():
deduplicated by removing nearby or overlapping polygons,
as determined by the 'deduplicate_centroid_tolerance' and
'deduplicate_overlap_tolerance' options. Note that with
release 0.1.0, the 'neighbor' method has been not been
release 0.9.0, the 'neighbor' method has been not been
thoroughly tested. Only the 'footprints' method has been
thoroughly tested and should be applied to input data,
as this release is tailored to a dataset that requires
Expand Down Expand Up @@ -280,7 +280,7 @@ class ConfigManager():
the intersecting polygons to be considered a duplicate. If
False, then the overlap_tolerance proportion must be True
for only one of the intersecting polygons to be considered
a duplicate. Default is True. Note that with release 0.1.0,
a duplicate. Default is True. Note that with release 0.9.0,
the 'neighbor' method has been not been thoroughly tested
and should not be applied to input data.
- deduplicate_centroid_tolerance : float, optional
Expand All @@ -300,14 +300,14 @@ class ConfigManager():
before calculating the distance between them.
centroid_tolerance will use the units of this CRS. Set to
None to skip the re-projection and use the CRS of the
GeoDataFrame. Note that with release 0.1.0,
GeoDataFrame. Note that with release 0.9.0,
the 'neighbor' method has been not been thoroughly tested
and should not be applied to input data.
- deduplicate_clip_to_footprint : bool, optional
For the 'footprints' deduplication method only. If True,
then polygons that fall outside the bounds of the
associated footprint will be removed. Default is True for
release version 0.1.0, but will be false for future releases.
release version 0.9.0, but will be false for future releases.
- deduplicate_clip_method: str, optional
For the 'footprints' deduplication method only, when
deduplicate_clip_to_footprint is True. The method to use to
Expand Down Expand Up @@ -1325,7 +1325,7 @@ def get_deduplication_method(self):
method = self.get('deduplicate_method')
if(method == 'neighbor'):
logger.warning(f"Deduplication method 'neighbors' has not been"
f"tested for release 0.1.0. Please use deduplication"
f"tested for release 0.9.0. Please use deduplication"
f"method 'footprints' or None for this release.")
return deduplicate_neighbors
if(method == 'footprints'):
Expand Down
4 changes: 2 additions & 2 deletions pdgstaging/Deduplicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def deduplicate_by_footprint(
return_intersections : bool, optional
If true, the polygons that represent the intersections between
footprints will be returned. Default is False. Not currently available
in this release 0.1.0. return_intersections is to be integrated again
in this release 0.9.0. return_intersections is to be integrated again
in future releases.
prop_duplicated : str, optional
Defaults to "staging_duplicated". The column name / property to use to
Expand All @@ -522,7 +522,7 @@ def deduplicate_by_footprint(
`intersections` represents the polygon area where the footprints overlap.
It has not been integrated into the function again since the deduplication
approach changed from returning a dictionary to returning a labeled GDF.
This will be integrated again in releases after 0.1.0.
This will be integrated again in releases after 0.9.0.
"""

logger.info(f"Executing deduplicate_by_footprint() for {gdf}")
Expand Down
34 changes: 0 additions & 34 deletions pdgstaging/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,6 @@
import argparse
from pdgstaging import TileStager

# Set up logging (TODO: move to logging config file)

# log_dict = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'formatters': {
# 'standard': {
# 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
# },
# },
# 'handlers': {
# 'default': {
# 'level': 'INFO',
# 'formatter': 'standard',
# 'class': 'logging.StreamHandler',
# },
# 'file_handler': {
# 'level': 'INFO',
# 'filename': 'viz-staging.log',
# 'class': 'logging.FileHandler',
# 'formatter': 'standard'
# }
# },
# 'loggers': {
# '': {
# 'handlers': ['file_handler'],
# 'level': 'INFO',
# 'propagate': True
# },
# }
# }

# logging.config.dictConfig(log_dict)

if __name__ == '__main__':

parser = argparse.ArgumentParser(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
author='Robyn Thiessen-Bock',
author_email='thiessenbock@nceas.ucsb.edu',
name='pdgstaging',
version='0.1.0',
version='0.9.0',
description='PDG Visualization staging pipeline',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit c84e8cc

Please sign in to comment.