kraina-ai / srai

Spatial Representations for Artificial Intelligence - a Python library toolkit for geospatial machine learning focused on creating embeddings for downstream tasks
https://kraina-ai.github.io/srai/
Apache License 2.0
220 stars 17 forks source link

457 geovex model saving loading #460

Closed sabman closed 3 months ago

sabman commented 3 months ago

work for #457

This PR adds:

GeoVexEmbedder:
  save
  cls.load

It also adds a test to save and load GeoVexEmbedder. We have been running it via: but hopefully CI runs the full suite.

PYTHONPATH=. pytest tests/embedders/geovex/test_embedder.py::test_embedder_save_load

Our first PR to this awesome project, apologies in advance for any oversights but happy to learn best practices from feedback and contribute more.

Co-authored with @mhassanch

piotrgramacki commented 3 months ago

Hi @sabman,

Thank you for this contribution. This feature is vital for us, so having this PR to work with is excellent! We'll review it and lat you know if anything needs to be added before merging it into srai.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.21%. Comparing base (23ee20e) to head (af3b541). Report is 1 commits behind head on main.

Files Patch % Lines
srai/embedders/geovex/embedder.py 93.75% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #460 +/- ## ========================================== + Coverage 89.74% 90.21% +0.46% ========================================== Files 62 62 Lines 2439 2474 +35 ========================================== + Hits 2189 2232 +43 + Misses 250 242 -8 ``` | [Flag](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | Coverage Δ | | |---|---|---| | [macos-13-python3.12](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.21% <94.59%> (+0.55%)` | :arrow_up: | | [ubuntu-latest-python3.10](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.09% <94.59%> (+0.42%)` | :arrow_up: | | [ubuntu-latest-python3.11](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.01% <94.59%> (+0.34%)` | :arrow_up: | | [ubuntu-latest-python3.12](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.09% <94.59%> (+0.42%)` | :arrow_up: | | [ubuntu-latest-python3.9](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.20% <94.59%> (+0.46%)` | :arrow_up: | | [windows-latest-python3.12](https://app.codecov.io/gh/kraina-ai/srai/pull/460/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai) | `90.21% <94.59%> (+0.55%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kraina-ai#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

RaczeQ commented 3 months ago

FYI @sabman @mhassanch changes have been released with version 0.7.6