Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Distributed Excluded Zone] Handle when depart is in an excluded zone #4229

Merged
merged 15 commits into from
Mar 6, 2024

Conversation

xlqian
Copy link
Member

@xlqian xlqian commented Mar 1, 2024

@xlqian xlqian marked this pull request as ready for review March 1, 2024 17:18
@xlqian xlqian requested review from azime, adrien3d and pbench March 1, 2024 17:18
@classmethod
@cache.memoize(app.config[str('CACHE_CONFIGURATION')].get(str('ASGARD_S3_DATA_TIMEOUT'), 1 * 60))
def is_excluded(cls, obj, mode, timestamp):
print(mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

@classmethod
@cache.memoize(app.config[str('CACHE_CONFIGURATION')].get(str('ASGARD_S3_DATA_TIMEOUT'), 1 * 60))
def is_excluded(cls, obj, mode, timestamp):
print(mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(mode)
print(mode)

to remove


from jormungandr import app, memory_cache, cache
from jormungandr.resource_s3_object import ResourceS3Object


class ExcludedZonesManager:
excluded_shapes = dict() # type: Dict[str, shapely.geometry]

@staticmethod
@cache.memoize(app.config[str('CACHE_CONFIGURATION')].get(str('ASGARD_S3_DATA_TIMEOUT'), 24 * 60))
def get_object(resource_s3_object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add instance_publication_date

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for excluded_zones, they have nothing to do with the data of instance, it does not make sense to relate excluded_zones to instance_publication_date

)
cls.excluded_shapes = [shapely.wkt.loads(zone.get('shape', '')) for zone in excluded_zones]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load may not work, no ?

Copy link
Contributor

@kadhikari kadhikari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me 👍

@xlqian xlqian merged commit db3c526 into dev Mar 6, 2024
8 checks passed
@xlqian xlqian deleted the handle_when_depart_is_in_an_excluded_zone branch March 6, 2024 10:26
Copy link

sonarqubecloud bot commented Mar 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants