Skip to content

Commit a70c139

Browse files
authored
Merge pull request #102 from MiraGeoscience/GEOPY-2741
GEOPY-2741: Continue update to Python 3.12
2 parents 9230837 + fc1dc07 commit a70c139

43 files changed

Lines changed: 3240 additions & 10567 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python_analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
package-manager: 'conda'
3535
app-name: 'curve_apps'
36-
python-version: '3.10'
36+
python-version: '3.12'
3737
call-workflow-pytest:
3838
name: Pytest
3939
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@v2
@@ -42,10 +42,10 @@ jobs:
4242
pull-requests: read
4343
with:
4444
package-manager: 'conda'
45-
python-versions: '["3.10", "3.11", "3.12"]'
45+
python-versions: '["3.12", "3.13"]'
4646
os: '["ubuntu-latest", "windows-latest"]'
4747
cache-number: 1
48-
codecov-reference-python-version: '3.10'
48+
codecov-reference-python-version: '3.12'
4949
codecov-reference-os: '["windows-latest"]'
5050
secrets:
5151
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/python_deploy_dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
contents: write
2121
with:
2222
package-name: 'curve-apps'
23-
python-version: '3.10'
23+
python-version: '3.12'
2424
source-repo-names: '["public-noremote-conda-dev"]'
2525
conda-channels: '["conda-forge"]'
2626
publish-repo-names: '["public-noremote-conda-dev"]'
@@ -37,7 +37,7 @@ jobs:
3737
package-manager: 'poetry'
3838
package-name: 'curve-apps'
3939
version-tag: ${{ github.ref_name }}
40-
python-version: '3.10'
40+
python-version: '3.12'
4141
virtual-repo-names: '["public-pypi-dev", "test-pypi"]'
4242
secrets:
4343
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}

.idea/curve-apps.iml

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ repos:
3535
hooks:
3636
- id: mypy
3737
additional_dependencies: [
38-
numpy==1.26.*,
39-
pydantic==2.5.*,
38+
numpy==2.4.*,
39+
pydantic==2.12.*,
4040
types-toml,
4141
types-waitress==3.0.*,
4242
types-PyYAML,

curve_apps/contours/options.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def has_intervals(self) -> bool:
9191
def intervals(self) -> list[float]:
9292
"""Returns arange of requested contour intervals."""
9393

94-
if self.has_intervals:
94+
if (
95+
self.interval_min is not None
96+
and self.interval_max is not None
97+
and self.interval_spacing is not None
98+
and self.interval_spacing != 0
99+
):
95100
intervals = np.arange(
96101
self.interval_min,
97102
self.interval_max + self.interval_spacing / 2, # type: ignore

curve_apps/peak_finder/line_group.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import numpy as np
1616

17+
from curve_apps.peak_finder.anomaly import Anomaly
1718
from curve_apps.peak_finder.anomaly_group import AnomalyGroup
1819
from curve_apps.peak_finder.line_data import LineData
1920
from curve_apps.peak_finder.line_position import LinePosition
@@ -282,11 +283,12 @@ def group_n_groups(self, groups: list[AnomalyGroup]) -> list[AnomalyGroup]:
282283

283284
return_groups: list[AnomalyGroup] = []
284285
all_starts = np.array([group.start for group in groups])
285-
sort_inds = np.argsort(all_starts)
286-
sorted_groups: list[AnomalyGroup] = list(np.array(groups)[sort_inds])
287-
288-
max_separation = np.ceil(self.max_separation / self.position.sampling)
289-
neighbours_list = self.find_neighbour_groups(sorted_groups, max_separation)
286+
sorted_groups: list[AnomalyGroup] = list(
287+
np.array(groups)[np.argsort(all_starts)]
288+
)
289+
neighbours_list = self.find_neighbour_groups(
290+
sorted_groups, np.ceil(self.max_separation / self.position.sampling)
291+
)
290292

291293
if len(neighbours_list) == 0:
292294
return return_groups
@@ -304,8 +306,12 @@ def group_n_groups(self, groups: list[AnomalyGroup]) -> list[AnomalyGroup]:
304306
if len(indices) < self.n_groups:
305307
continue
306308

309+
anomalies: list[Anomaly] = []
310+
for ind in indices:
311+
anomalies += sorted_groups[ind].anomalies.tolist()
312+
307313
new_group = AnomalyGroup(
308-
np.concatenate([sorted_groups[ind].anomalies for ind in indices]),
314+
anomalies,
309315
self.property_group,
310316
subgroups={sorted_groups[ind] for ind in indices},
311317
)

curve_apps/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def get_contour_list(params: ContourDetectionParameters) -> list[float]:
117117
"""
118118

119119
if (
120-
None not in [params.interval_min, params.interval_max, params.interval_spacing]
120+
params.interval_min is not None
121+
and params.interval_max is not None
122+
and params.interval_spacing is not None
121123
and params.interval_spacing != 0
122124
):
123125
interval_contours = np.arange(

deps-lock-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
include_dev: True
22
py_versions:
3-
- "3.10"
4-
- "3.11"
53
- "3.12"
4+
- "3.13"
65
suffix_for_extras:
76
"": ["webview"]
87
"raw": [""]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies:
2-
- python=3.10.*
2+
- python=3.13.*
33
- pip
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies:
2-
- python=3.11.*
2+
- python=3.14.*
33
- pip

0 commit comments

Comments
 (0)