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

Prepare release 1.7.12 #354

Merged
merged 6 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"

- uses: pre-commit/[email protected]
with:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: pip # caching the entire environment is faster when cache exists but slower for cache creation

- name: Install packages
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ repos:
types_or: [json]

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.4.9"
rev: "v0.6.8"
hooks:
- id: ruff

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-ruff
2 changes: 1 addition & 1 deletion eogrow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The main module of the eo-grow package."""

__version__ = "1.7.11"
__version__ = "1.7.12"
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ dependencies = [
"colorlog",
"boto3<=1.29.6",
"eo-learn[VISUALIZATION]>=1.5.0",
"fiona",
"fiona>=1.8.18; python_version>='3.9'",
"fiona>=1.8.18,<1.10; python_version<'3.9'",
"fs>=2.2.0",
"geopandas>=0.8.1",
"numpy<2",
"geopandas>=0.14.4,<1; python_version>='3.9'",
"geopandas>=0.11.0,<1; python_version<'3.9'",
"numpy",
"opencv-python-headless",
"pandas",
"pydantic>=1.8.0, <2.0",
Expand Down Expand Up @@ -77,6 +79,7 @@ dev = [
"build",
"deepdiff",
"fs_s3fs",
"numpy>=2.0.0; python_version>='3.9'",
"moto[s3]>=5.0.0",
"mypy>=0.990",
"pre-commit",
Expand Down Expand Up @@ -165,7 +168,7 @@ lint.ignore = [
"PT011", # complains for `pytest.raises(ValueError)` but we use it a lot
]
lint.per-file-ignores = { "__init__.py" = ["F401"] }
exclude = [".git", "__pycache__", "build", "dist"]
exclude = [".git", "__pycache__", "build", "dist", "*.ipynb"]


[tool.ruff.lint.isort]
Expand Down
2 changes: 1 addition & 1 deletion tests/core/area/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_no_batch_id_error(storage, area_config):
manager.get_grid()


@pytest.mark.integration()
@pytest.mark.integration
@pytest.mark.usefixtures("configured_requests_mock")
def test_grid(storage, area_config):
manager = BatchAreaManager.from_raw_config(area_config, storage)
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/test_byoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get_tile_cover_geometry_mock(_: str) -> Geometry:
return pipeline, relevant_requests


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.parametrize(("preparation_config", "config"), [("prepare_lulc_data", "ingest_lulc")])
@pytest.mark.order(after=["test_rasterize.py::test_rasterize_feature_with_resolution"])
def test_timeless_byoc(config_and_stats_paths, preparation_config, config, configured_requests_mock):
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pytestmark = pytest.mark.integration


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.order(before=["test_download_pipeline"])
@pytest.mark.usefixtures("storage")
def test_preparation():
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/test_import_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pytestmark = pytest.mark.integration


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.parametrize("experiment_name", ["import_vector", "import_vector_temporal"])
def test_import_vector_pipeline(config_and_stats_paths, experiment_name):
config_path, stats_path = config_and_stats_paths("import_vector", experiment_name)
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/test_merge_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pytestmark = pytest.mark.integration


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.order(after="test_features.py::test_features_pipeline")
def test_merge_samples_pipeline(config_and_stats_paths):
config_path, stats_path = config_and_stats_paths("merge_samples", "merge_features_samples")
Expand Down
4 changes: 2 additions & 2 deletions tests/pipelines/test_rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_rasterize_file(config_and_stats_paths, experiment_name):
compare_content(output_path, stats_path)


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.order(before="test_rasterize_feature_with_resolution")
@pytest.mark.parametrize(("preparation_config", "config"), [("load_crops_vector_data", "rasterize_feature_with_shape")])
def test_rasterize_feature_with_shape(config_and_stats_paths, preparation_config, config):
Expand All @@ -24,7 +24,7 @@ def test_rasterize_feature_with_shape(config_and_stats_paths, preparation_config
compare_content(output_path, stats_path)


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.parametrize(
("preparation_config", "config"), [("load_lulc_vector_data", "rasterize_feature_with_resolution")]
)
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pytestmark = pytest.mark.integration


@pytest.mark.chain()
@pytest.mark.chain
@pytest.mark.parametrize("experiment_name", ["testing", "timestamps_only"])
def test_data_generating_pipeline(config_and_stats_paths, experiment_name):
config_path, stats_path = config_and_stats_paths("testing", experiment_name)
Expand Down
6 changes: 3 additions & 3 deletions tests/tasks/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def test_linear_function_task():
[data_feature, mask_timeless_feature],
[data_result_feature, mask_timeless_result_feature],
slope=2,
intercept=-5,
intercept=+5,
)
task_double_minus_five(eopatch)
expected_result = np.arange(np.prod(data_shape)).reshape(data_shape).astype(float) * 2 - 5
expected_result = np.arange(np.prod(data_shape)).reshape(data_shape).astype(float) * 2 + 5
assert np.array_equal(eopatch[data_result_feature], expected_result)
assert np.array_equal(eopatch[mask_timeless_result_feature], np.ones(mask_shape) * 2 - 5)
assert np.array_equal(eopatch[mask_timeless_result_feature], np.ones(mask_shape) * 2 + 5)
assert eopatch[data_result_feature].dtype == np.float32
# The value of the mask timeless changes here

Expand Down
2 changes: 1 addition & 1 deletion tests/tasks/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)


@pytest.fixture()
@pytest.fixture
def dummy_eopatch() -> EOPatch:
return EOPatch(bbox=BBox((0, 0, 1, 1), CRS.POP_WEB))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_pipeline_chain_validation(config_folder):
assert subprocess.call(f"eogrow-validate {config_folder}/chain_pipeline.json", shell=True) == 0


@pytest.mark.integration()
@pytest.mark.integration
@pytest.mark.order(after="tests/pipelines/test_zipmap.py::test_zipmap_pipeline")
def test_pipeline_chain_execution(config_folder):
"""Tests a simple execution from command line"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dtype": "float32",
"histogram": {
"counts": [7046664, 5964028, 1206792, 268781, 43749, 4429, 63, 14],
"counts": [7046664, 5965840, 1204980, 268781, 43749, 4429, 63, 14],
"edges": [
0.0006, 0.15015, 0.2997, 0.44925, 0.5988, 0.74835, 0.8979, 1.04745,
1.197
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stats/features/features_dtype.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
140579, 624836, 1721408, 9943223, 2177532, 205367, 9027, 44
],
"edges": [
-0.693802, -0.457451, -0.221101, 0.015249, 0.251599, 0.487949,
-0.693802, -0.457451, -0.221101, 0.0152491, 0.251599, 0.487949,
0.7243, 0.96065, 1.197
]
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stats/import_tiff/import_tiff_temporal.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dtype": "float32",
"histogram": {
"counts": [
299415, 299725, 300061, 299722, 299399, 298483, 299305, 299690
299415, 299725, 300061, 299723, 299398, 298483, 299303, 299692
],
"edges": [
0.00125003, 1250.0, 2500.0, 3750.0, 5000.0, 6250.0, 7500.0, 8750.0,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stats/sampling/sampling_block_fraction.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"dtype": "float32",
"histogram": {
"counts": [
2195347, 3494725, 1606303, 405891, 123943, 17915, 3865, 761
2195347, 3494725, 1606303, 406139, 123695, 17915, 3865, 761
],
"edges": [
0.0006, 0.110175, 0.21975, 0.329325, 0.4389, 0.548475, 0.65805,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_stats/sampling/sampling_chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
"histogram": {
"counts": [95600, 166829, 73548, 21212, 5658, 874, 236, 43],
"edges": [
0.0006, 0.109563, 0.218525, 0.327487, 0.43645, 0.545413, 0.654375,
0.763338, 0.8723
0.0006, 0.109563, 0.218525, 0.327488, 0.43645, 0.545413, 0.654375,
0.763337, 0.8723
]
},
"random_values": [
Expand Down
20 changes: 10 additions & 10 deletions tests/test_stats/split_grid/split_batch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"histogram": {
"counts": [81099, 81175, 80959, 81555, 81116, 81180, 81485, 81135],
"edges": [
-0.999997, -0.749998, -0.499999, -0.25, -6.25849e-7, 0.249998,
-0.999997, -0.749998, -0.499999, -0.25, -5.96046e-7, 0.249998,
0.499998, 0.749997, 0.999996
]
},
Expand Down Expand Up @@ -75,7 +75,7 @@
"histogram": {
"counts": [80952, 81115, 81551, 81042, 81520, 81010, 80990, 81524],
"edges": [
-0.999996, -0.749997, -0.499997, -0.249998, 1.2815e-6, 0.250001,
-0.999996, -0.749997, -0.499997, -0.249998, 1.2517e-6, 0.250001,
0.5, 0.749999, 0.999999
]
},
Expand Down Expand Up @@ -299,7 +299,7 @@
"histogram": {
"counts": [81355, 81440, 81149, 81669, 80330, 80916, 81561, 81284],
"edges": [
-0.999999, -0.749999, -0.499999, -0.249999, 6.25849e-7, 0.25, 0.5,
-0.999999, -0.749999, -0.499999, -0.249999, 5.96046e-7, 0.25, 0.5,
0.75, 1.0
]
},
Expand Down Expand Up @@ -476,7 +476,7 @@
"histogram": {
"counts": [81352, 81080, 81031, 81250, 81097, 81043, 81291, 81560],
"edges": [
-0.999999, -0.750001, -0.500002, -0.250004, -5.21541e-6, 0.249993,
-0.999999, -0.750001, -0.500002, -0.250004, -5.24521e-6, 0.249993,
0.499992, 0.74999, 0.999989
]
},
Expand Down Expand Up @@ -532,7 +532,7 @@
"histogram": {
"counts": [81166, 80601, 81258, 81071, 81689, 81605, 81162, 81152],
"edges": [
-0.999996, -0.749998, -0.500001, -0.250003, -5.39422e-6, 0.249992,
-0.999996, -0.749998, -0.500001, -0.250003, -5.42402e-6, 0.249992,
0.49999, 0.749988, 0.999985
]
},
Expand Down Expand Up @@ -588,7 +588,7 @@
"histogram": {
"counts": [81375, 81457, 81278, 81075, 81230, 81498, 80701, 81090],
"edges": [
-0.999997, -0.749998, -0.499998, -0.249999, 1.10269e-6, 0.250001,
-0.999997, -0.749998, -0.499998, -0.249999, 1.07288e-6, 0.250001,
0.5, 0.75, 1.0
]
},
Expand Down Expand Up @@ -700,7 +700,7 @@
"histogram": {
"counts": [81038, 81161, 80929, 81425, 80889, 81299, 81302, 81661],
"edges": [
-0.999993, -0.749994, -0.499995, -0.249996, 3.01003e-6, 0.250002,
-0.999993, -0.749994, -0.499995, -0.249996, 3.03984e-6, 0.250002,
0.500001, 0.75, 0.999999
]
},
Expand Down Expand Up @@ -756,7 +756,7 @@
"histogram": {
"counts": [81179, 81366, 81157, 81213, 81082, 81005, 81406, 81296],
"edges": [
-0.999992, -0.749993, -0.499994, -0.249995, 3.96371e-6, 0.250003,
-0.999992, -0.749993, -0.499994, -0.249995, 3.99351e-6, 0.250003,
0.500002, 0.750001, 1.0
]
},
Expand Down Expand Up @@ -812,7 +812,7 @@
"histogram": {
"counts": [81429, 81088, 81158, 80961, 81378, 80960, 81424, 81306],
"edges": [
-1.0, -0.750001, -0.500001, -0.250002, -3.06964e-6, 0.249996,
-1.0, -0.750001, -0.500001, -0.250002, -3.03984e-6, 0.249996,
0.499995, 0.749994, 0.999994
]
},
Expand Down Expand Up @@ -868,7 +868,7 @@
"histogram": {
"counts": [80874, 81304, 81324, 81556, 81586, 80964, 80988, 81108],
"edges": [
-1.0, -0.75, -0.500001, -0.250001, -1.63913e-6, 0.249998, 0.499997,
-1.0, -0.75, -0.500001, -0.250001, -1.66893e-6, 0.249998, 0.499997,
0.749997, 0.999996
]
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stats/testing/testing.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"histogram": {
"counts": [32, 850, 6125, 17779, 20096, 8735, 1426, 82],
"edges": [
-409.49, -307.796, -206.101, -104.407, -2.71254, 98.9819, 200.676,
-409.49, -307.796, -206.101, -104.407, -2.71252, 98.9819, 200.676,
302.371, 404.065
]
},
Expand Down
Loading