rainfall-thresholds 0.4.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/PKG-INFO +41 -15
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/README.md +40 -14
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/pyproject.toml +5 -3
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/pyproject.toml.orig +5 -3
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/__init__.py +9 -0
- rainfall_thresholds-0.5.1/src/rainfall_thresholds/assess.py +330 -0
- rainfall_thresholds-0.5.1/src/rainfall_thresholds/facts.py +332 -0
- rainfall_thresholds-0.5.1/src/rainfall_thresholds/mcp_server.py +254 -0
- rainfall_thresholds-0.5.1/src/rainfall_thresholds/trust.py +119 -0
- rainfall_thresholds-0.4.0/src/rainfall_thresholds/assess.py +0 -176
- rainfall_thresholds-0.4.0/src/rainfall_thresholds/facts.py +0 -150
- rainfall_thresholds-0.4.0/src/rainfall_thresholds/mcp_server.py +0 -126
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/LICENSE +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/antecedent.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/check.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/events.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/fit.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/italy.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/measure.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/py.typed +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/regional.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/regional_thresholds.toml +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/sources.py +0 -0
- {rainfall_thresholds-0.4.0 → rainfall_thresholds-0.5.1}/src/rainfall_thresholds/threshold.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rainfall-thresholds
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: Rainfall intensity-duration thresholds for shallow landslides (Caine power law, frequentist fitting)
|
|
5
5
|
Keywords: landslide,rainfall threshold,intensity-duration,caine,hydrology,natural hazards,italy,italica
|
|
6
6
|
Author: Giuseppe Zileni
|
|
@@ -474,9 +474,9 @@ rainfall part of a simple monitoring loop: a number to watch, not an alert.
|
|
|
474
474
|
| `cutoff_at_budget(ordinary, budget, *, floor=None)` | function | that cutoff |
|
|
475
475
|
| `Skill` | frozen dataclass | `caught`, `landslides`, `alerts`, `ordinary`, `unmeasured`; `.hit_rate`, `.alert_share`, `.discrimination`, `.alerts_per_caught` |
|
|
476
476
|
| `auc(landslides, ordinary)` | function | Mann-Whitney AUC, ties count half |
|
|
477
|
-
| `facts.threshold_facts`, `assess_facts`, `fit_facts` | functions | the same answers as JSON-ready dicts, with units and the alert rule |
|
|
477
|
+
| `facts.threshold_facts`, `assess_facts`, `fit_facts`, `trust_facts`, `margin_facts`, `published_facts` | functions | the same answers as JSON-ready dicts, with units and the alert rule |
|
|
478
478
|
| `check.check_text(text, facts, *, question="")` | function | numbers of a text that are invented, rounded or in the wrong unit → `list[Misquote]` |
|
|
479
|
-
| `mcp_server.create_server()`, `rainfall-thresholds-mcp` | MCP (extra `mcp`) | tools `threshold`, `assess`, `fit`, `
|
|
479
|
+
| `mcp_server.create_server()`, `rainfall-thresholds-mcp` | MCP (extra `mcp`) | tools `threshold`, `assess`, `fit`, `trust`, `margin`, `published`, `check`; stdio or HTTP |
|
|
480
480
|
| `ITALICA_T5` | read-only mapping | `"italy"`, `"northern"`, `"central"`, `"southern"` → `PowerLawThreshold` |
|
|
481
481
|
| `MACROREGIONS` | read-only mapping | macroregion → set of region names (e-ITALICA spelling) |
|
|
482
482
|
| `macroregion_of(region)` | function | region name or ISTAT region code (`8`, `"08"`) → macroregion, or `None` |
|
|
@@ -488,6 +488,10 @@ rainfall part of a simple monitoring loop: a number to watch, not an alert.
|
|
|
488
488
|
| `caine_excess(event, threshold, *, radar_gauge_factor=1.0)` | function | decades above the line, zero on or below it |
|
|
489
489
|
| `api_kohler_linsley(daily_precip_mm, *, decay_k, initial=0.0)` | function | the Antecedent Precipitation Index, mm |
|
|
490
490
|
| `api_factor(api_mm, *, fallback_baseline_mm, fallback_sigma_mm, sigma_min_mm, baseline_mm=None, sigma_mm=None)` | function | an API as a wetness factor in 0..1; 0.5 when not known |
|
|
491
|
+
| `rain_to_threshold(event, threshold, *, more_hours, radar_gauge_factor=1.0)` | function | the rain still needed to reach the line if the event goes on → `{hours: mm}`; not a forecast |
|
|
492
|
+
| `relative_total(hours, end, *, window_hours, reference_mm, saturation, reduction=0.0, longer_references_mm=None)` | function | the last hours against the place's own climatological reference, 0..1; `None` when no hour was read |
|
|
493
|
+
| `EventAssessment.as_record(*, where, licence)` | method | the assessment as a fact of `opendata-record/v2`, a plain dict |
|
|
494
|
+
| `CALIBRATION`, `calibration_of(region)` | mapping, function | how the line sits on the landslides of each region → `Calibration`: `events`, `below`, `.below_share`, `.interval()`, `.position` (`"high"`, `"low"`, `"as fitted"`), `duration_hours` |
|
|
491
495
|
| `load_regional_catalogue()` | function | published regional thresholds with their sources → `RegionalCatalogue` of `RegionalThreshold` and `Source` |
|
|
492
496
|
| `RainSource` | `typing.Protocol` | `hourly(points, start, end) -> dict[datetime, list[float or None]]`: what can feed the package |
|
|
493
497
|
| `point_series(rain, index)` | function | the series of one point out of `RainSource.hourly` |
|
|
@@ -511,22 +515,27 @@ uv run python -m benchmarks.run
|
|
|
511
515
|
|
|
512
516
|
## Notebooks and Docker
|
|
513
517
|
|
|
514
|
-
|
|
518
|
+
Five [example notebooks](https://github.com/agent-engineering-studio/rainfall-thresholds/tree/main/notebooks):
|
|
515
519
|
the Italian thresholds over the e-ITALICA landslides, the storm of Melito on
|
|
516
|
-
the DPC radar,
|
|
517
|
-
with the
|
|
520
|
+
the DPC radar, fitting your own threshold, and how much to trust the line in
|
|
521
|
+
each region with the rain still missing during a storm, with no network; and
|
|
522
|
+
the join with the sister libraries, landslides dated by
|
|
518
523
|
[ispra-idrogeo](https://agentengineering.it/ispra-idrogeo/) against radar rain
|
|
519
524
|
from [dpc-radar](https://agentengineering.it/dpc-radar/). Open them with uv, or
|
|
520
525
|
with Docker alone:
|
|
521
526
|
|
|
522
527
|
```bash
|
|
523
528
|
uv run --group examples jupyter lab notebooks/
|
|
524
|
-
docker
|
|
529
|
+
make docker # the bench (3001), the MCP server (8775), the notebooks (8881)
|
|
530
|
+
docker compose up notebooks # the notebooks alone: http://localhost:8881
|
|
525
531
|
make docker-bench # the benchmark, in a container
|
|
532
|
+
make down # stop and remove the containers
|
|
526
533
|
```
|
|
527
534
|
|
|
528
|
-
|
|
529
|
-
|
|
535
|
+
`make help` lists every command. The containers are named after the library
|
|
536
|
+
(`rainfall-thresholds-ui`, `-mcp`, `-notebooks`) and the ports clash with no
|
|
537
|
+
sister library, so all of them run on one machine; for a second copy of this
|
|
538
|
+
one, change the prefix and the ports (`make docker NAME=rt-dev TARATURA_PORT=3101 ...`).
|
|
530
539
|
|
|
531
540
|
## A calibration bench for public bodies
|
|
532
541
|
|
|
@@ -548,21 +557,26 @@ interactive intensity-duration plane that runs in the browser.
|
|
|
548
557
|
A language model may word the numbers; it should never compute them. The
|
|
549
558
|
library gives them as data, and checks the words.
|
|
550
559
|
|
|
551
|
-
- **Facts.** `rainfall_thresholds.facts`: `threshold_facts`, `assess_facts
|
|
552
|
-
|
|
560
|
+
- **Facts.** `rainfall_thresholds.facts`: `threshold_facts`, `assess_facts`,
|
|
561
|
+
`fit_facts`, `trust_facts` (how the line sits on the landslides of a
|
|
562
|
+
region), `margin_facts` (the rain still needed if the rain goes on) and
|
|
563
|
+
`published_facts` (the thresholds of the literature for a region, with
|
|
564
|
+
their sources) return plain dicts, with the unit in every key (`_mm`,
|
|
553
565
|
`_mm_h`, `_h`, `_decades`), what the threshold was fitted on, and the rule
|
|
554
566
|
that a threshold exceeded is not an alert.
|
|
555
567
|
- **MCP server.** `pip install "rainfall-thresholds[mcp]"`, then
|
|
556
|
-
`rainfall-thresholds-mcp` on standard input and output
|
|
557
|
-
|
|
558
|
-
|
|
568
|
+
`rainfall-thresholds-mcp` on standard input and output, or over HTTP
|
|
569
|
+
(`--transport streamable-http`, port 8775, `/mcp`; `docker compose up mcp`).
|
|
570
|
+
Seven tools: `threshold`, `assess`, `fit`, `trust`, `margin`, `published`,
|
|
571
|
+
`check`. They compute only from what the call gives them: no network, no
|
|
572
|
+
live rain.
|
|
559
573
|
- **A check of the text.** `check_text(text, facts)` finds numbers invented,
|
|
560
574
|
rounded the wrong way, or in the wrong unit: 30.9 mm written as 30.9 mm/h,
|
|
561
575
|
the trap of every rainfall threshold. It knows that a number is a fact of
|
|
562
576
|
its unit, not that it is said of the right thing.
|
|
563
577
|
- **A faithfulness set.** `benchmarks/faithful.py`: questions, facts, and
|
|
564
578
|
answers written by hand, one faithful and one with known faults; in CI the
|
|
565
|
-
check must find exactly those faults (
|
|
579
|
+
check must find exactly those faults (10 of 10 today). Answers of a model are
|
|
566
580
|
not in it yet.
|
|
567
581
|
- **For coding agents.** [`llms.txt`](https://agentengineering.it/rainfall-thresholds/llms.txt),
|
|
568
582
|
[`llms-full.txt`](https://agentengineering.it/rainfall-thresholds/llms-full.txt)
|
|
@@ -603,6 +617,18 @@ says what each phase measured.
|
|
|
603
617
|
those that triggered landslides before", not "a landslide will happen
|
|
604
618
|
here". Slope, soil, vegetation and antecedent wetness all matter. Use it
|
|
605
619
|
as one input to a warning system, alongside expert judgement.
|
|
620
|
+
- **The line is not equally good everywhere.** A T5 line leaves 5 % of the
|
|
621
|
+
landslides of its macroregion below it; region by region the share goes
|
|
622
|
+
from 1.3 % in Calabria (4 of 298) to 16.2 % in Valle d'Aosta (11 of 68).
|
|
623
|
+
`calibration_of(region)` says where it sits high, where low, and where the
|
|
624
|
+
landslides are too few to tell (Molise has 17).
|
|
625
|
+
- **A landslide with a day and no hour takes the end of its day.** When you
|
|
626
|
+
pair a dated landslide with hourly rain, the convention of this family of
|
|
627
|
+
libraries is the next local midnight in Europe/Rome after its day, as UTC:
|
|
628
|
+
1 January 2010 is 2010-01-01T23:00Z, 1 July 2010 is 2010-07-01T22:00Z. An
|
|
629
|
+
hour is labelled by its end, so the last hour before the landslide is the
|
|
630
|
+
one ending at that midnight. ispra-idrogeo gives the instant; notebook 04
|
|
631
|
+
shows it.
|
|
606
632
|
- **T5 is deliberately low.** By construction, 95 % of past triggering
|
|
607
633
|
events sit above it: it favours catching events over avoiding false
|
|
608
634
|
alarms.
|
|
@@ -448,9 +448,9 @@ rainfall part of a simple monitoring loop: a number to watch, not an alert.
|
|
|
448
448
|
| `cutoff_at_budget(ordinary, budget, *, floor=None)` | function | that cutoff |
|
|
449
449
|
| `Skill` | frozen dataclass | `caught`, `landslides`, `alerts`, `ordinary`, `unmeasured`; `.hit_rate`, `.alert_share`, `.discrimination`, `.alerts_per_caught` |
|
|
450
450
|
| `auc(landslides, ordinary)` | function | Mann-Whitney AUC, ties count half |
|
|
451
|
-
| `facts.threshold_facts`, `assess_facts`, `fit_facts` | functions | the same answers as JSON-ready dicts, with units and the alert rule |
|
|
451
|
+
| `facts.threshold_facts`, `assess_facts`, `fit_facts`, `trust_facts`, `margin_facts`, `published_facts` | functions | the same answers as JSON-ready dicts, with units and the alert rule |
|
|
452
452
|
| `check.check_text(text, facts, *, question="")` | function | numbers of a text that are invented, rounded or in the wrong unit → `list[Misquote]` |
|
|
453
|
-
| `mcp_server.create_server()`, `rainfall-thresholds-mcp` | MCP (extra `mcp`) | tools `threshold`, `assess`, `fit`, `
|
|
453
|
+
| `mcp_server.create_server()`, `rainfall-thresholds-mcp` | MCP (extra `mcp`) | tools `threshold`, `assess`, `fit`, `trust`, `margin`, `published`, `check`; stdio or HTTP |
|
|
454
454
|
| `ITALICA_T5` | read-only mapping | `"italy"`, `"northern"`, `"central"`, `"southern"` → `PowerLawThreshold` |
|
|
455
455
|
| `MACROREGIONS` | read-only mapping | macroregion → set of region names (e-ITALICA spelling) |
|
|
456
456
|
| `macroregion_of(region)` | function | region name or ISTAT region code (`8`, `"08"`) → macroregion, or `None` |
|
|
@@ -462,6 +462,10 @@ rainfall part of a simple monitoring loop: a number to watch, not an alert.
|
|
|
462
462
|
| `caine_excess(event, threshold, *, radar_gauge_factor=1.0)` | function | decades above the line, zero on or below it |
|
|
463
463
|
| `api_kohler_linsley(daily_precip_mm, *, decay_k, initial=0.0)` | function | the Antecedent Precipitation Index, mm |
|
|
464
464
|
| `api_factor(api_mm, *, fallback_baseline_mm, fallback_sigma_mm, sigma_min_mm, baseline_mm=None, sigma_mm=None)` | function | an API as a wetness factor in 0..1; 0.5 when not known |
|
|
465
|
+
| `rain_to_threshold(event, threshold, *, more_hours, radar_gauge_factor=1.0)` | function | the rain still needed to reach the line if the event goes on → `{hours: mm}`; not a forecast |
|
|
466
|
+
| `relative_total(hours, end, *, window_hours, reference_mm, saturation, reduction=0.0, longer_references_mm=None)` | function | the last hours against the place's own climatological reference, 0..1; `None` when no hour was read |
|
|
467
|
+
| `EventAssessment.as_record(*, where, licence)` | method | the assessment as a fact of `opendata-record/v2`, a plain dict |
|
|
468
|
+
| `CALIBRATION`, `calibration_of(region)` | mapping, function | how the line sits on the landslides of each region → `Calibration`: `events`, `below`, `.below_share`, `.interval()`, `.position` (`"high"`, `"low"`, `"as fitted"`), `duration_hours` |
|
|
465
469
|
| `load_regional_catalogue()` | function | published regional thresholds with their sources → `RegionalCatalogue` of `RegionalThreshold` and `Source` |
|
|
466
470
|
| `RainSource` | `typing.Protocol` | `hourly(points, start, end) -> dict[datetime, list[float or None]]`: what can feed the package |
|
|
467
471
|
| `point_series(rain, index)` | function | the series of one point out of `RainSource.hourly` |
|
|
@@ -485,22 +489,27 @@ uv run python -m benchmarks.run
|
|
|
485
489
|
|
|
486
490
|
## Notebooks and Docker
|
|
487
491
|
|
|
488
|
-
|
|
492
|
+
Five [example notebooks](https://github.com/agent-engineering-studio/rainfall-thresholds/tree/main/notebooks):
|
|
489
493
|
the Italian thresholds over the e-ITALICA landslides, the storm of Melito on
|
|
490
|
-
the DPC radar,
|
|
491
|
-
with the
|
|
494
|
+
the DPC radar, fitting your own threshold, and how much to trust the line in
|
|
495
|
+
each region with the rain still missing during a storm, with no network; and
|
|
496
|
+
the join with the sister libraries, landslides dated by
|
|
492
497
|
[ispra-idrogeo](https://agentengineering.it/ispra-idrogeo/) against radar rain
|
|
493
498
|
from [dpc-radar](https://agentengineering.it/dpc-radar/). Open them with uv, or
|
|
494
499
|
with Docker alone:
|
|
495
500
|
|
|
496
501
|
```bash
|
|
497
502
|
uv run --group examples jupyter lab notebooks/
|
|
498
|
-
docker
|
|
503
|
+
make docker # the bench (3001), the MCP server (8775), the notebooks (8881)
|
|
504
|
+
docker compose up notebooks # the notebooks alone: http://localhost:8881
|
|
499
505
|
make docker-bench # the benchmark, in a container
|
|
506
|
+
make down # stop and remove the containers
|
|
500
507
|
```
|
|
501
508
|
|
|
502
|
-
|
|
503
|
-
|
|
509
|
+
`make help` lists every command. The containers are named after the library
|
|
510
|
+
(`rainfall-thresholds-ui`, `-mcp`, `-notebooks`) and the ports clash with no
|
|
511
|
+
sister library, so all of them run on one machine; for a second copy of this
|
|
512
|
+
one, change the prefix and the ports (`make docker NAME=rt-dev TARATURA_PORT=3101 ...`).
|
|
504
513
|
|
|
505
514
|
## A calibration bench for public bodies
|
|
506
515
|
|
|
@@ -522,21 +531,26 @@ interactive intensity-duration plane that runs in the browser.
|
|
|
522
531
|
A language model may word the numbers; it should never compute them. The
|
|
523
532
|
library gives them as data, and checks the words.
|
|
524
533
|
|
|
525
|
-
- **Facts.** `rainfall_thresholds.facts`: `threshold_facts`, `assess_facts
|
|
526
|
-
|
|
534
|
+
- **Facts.** `rainfall_thresholds.facts`: `threshold_facts`, `assess_facts`,
|
|
535
|
+
`fit_facts`, `trust_facts` (how the line sits on the landslides of a
|
|
536
|
+
region), `margin_facts` (the rain still needed if the rain goes on) and
|
|
537
|
+
`published_facts` (the thresholds of the literature for a region, with
|
|
538
|
+
their sources) return plain dicts, with the unit in every key (`_mm`,
|
|
527
539
|
`_mm_h`, `_h`, `_decades`), what the threshold was fitted on, and the rule
|
|
528
540
|
that a threshold exceeded is not an alert.
|
|
529
541
|
- **MCP server.** `pip install "rainfall-thresholds[mcp]"`, then
|
|
530
|
-
`rainfall-thresholds-mcp` on standard input and output
|
|
531
|
-
|
|
532
|
-
|
|
542
|
+
`rainfall-thresholds-mcp` on standard input and output, or over HTTP
|
|
543
|
+
(`--transport streamable-http`, port 8775, `/mcp`; `docker compose up mcp`).
|
|
544
|
+
Seven tools: `threshold`, `assess`, `fit`, `trust`, `margin`, `published`,
|
|
545
|
+
`check`. They compute only from what the call gives them: no network, no
|
|
546
|
+
live rain.
|
|
533
547
|
- **A check of the text.** `check_text(text, facts)` finds numbers invented,
|
|
534
548
|
rounded the wrong way, or in the wrong unit: 30.9 mm written as 30.9 mm/h,
|
|
535
549
|
the trap of every rainfall threshold. It knows that a number is a fact of
|
|
536
550
|
its unit, not that it is said of the right thing.
|
|
537
551
|
- **A faithfulness set.** `benchmarks/faithful.py`: questions, facts, and
|
|
538
552
|
answers written by hand, one faithful and one with known faults; in CI the
|
|
539
|
-
check must find exactly those faults (
|
|
553
|
+
check must find exactly those faults (10 of 10 today). Answers of a model are
|
|
540
554
|
not in it yet.
|
|
541
555
|
- **For coding agents.** [`llms.txt`](https://agentengineering.it/rainfall-thresholds/llms.txt),
|
|
542
556
|
[`llms-full.txt`](https://agentengineering.it/rainfall-thresholds/llms-full.txt)
|
|
@@ -577,6 +591,18 @@ says what each phase measured.
|
|
|
577
591
|
those that triggered landslides before", not "a landslide will happen
|
|
578
592
|
here". Slope, soil, vegetation and antecedent wetness all matter. Use it
|
|
579
593
|
as one input to a warning system, alongside expert judgement.
|
|
594
|
+
- **The line is not equally good everywhere.** A T5 line leaves 5 % of the
|
|
595
|
+
landslides of its macroregion below it; region by region the share goes
|
|
596
|
+
from 1.3 % in Calabria (4 of 298) to 16.2 % in Valle d'Aosta (11 of 68).
|
|
597
|
+
`calibration_of(region)` says where it sits high, where low, and where the
|
|
598
|
+
landslides are too few to tell (Molise has 17).
|
|
599
|
+
- **A landslide with a day and no hour takes the end of its day.** When you
|
|
600
|
+
pair a dated landslide with hourly rain, the convention of this family of
|
|
601
|
+
libraries is the next local midnight in Europe/Rome after its day, as UTC:
|
|
602
|
+
1 January 2010 is 2010-01-01T23:00Z, 1 July 2010 is 2010-07-01T22:00Z. An
|
|
603
|
+
hour is labelled by its end, so the last hour before the landslide is the
|
|
604
|
+
one ending at that midnight. ispra-idrogeo gives the instant; notebook 04
|
|
605
|
+
shows it.
|
|
580
606
|
- **T5 is deliberately low.** By construction, 95 % of past triggering
|
|
581
607
|
events sit above it: it favours catching events over avoiding false
|
|
582
608
|
alarms.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "rainfall-thresholds"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.1"
|
|
4
4
|
description = "Rainfall intensity-duration thresholds for shallow landslides (Caine power law, frequentist fitting)"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
keywords = [
|
|
@@ -50,19 +50,21 @@ build-backend = "uv_build"
|
|
|
50
50
|
|
|
51
51
|
[dependency-groups]
|
|
52
52
|
dev = [
|
|
53
|
+
"jsonschema>=4.26.0",
|
|
53
54
|
"mcp>=2.3",
|
|
54
55
|
"mypy>=1.13",
|
|
55
56
|
"pytest>=8.3",
|
|
56
57
|
"pytest-asyncio>=0.24",
|
|
57
58
|
"pytest-cov>=6.0",
|
|
58
59
|
"ruff>=0.8",
|
|
60
|
+
"types-jsonschema>=4.26.0.20261006",
|
|
59
61
|
]
|
|
60
62
|
examples = [
|
|
61
63
|
"jupyterlab>=4.2",
|
|
62
64
|
"nbconvert>=7.16",
|
|
63
65
|
"matplotlib>=3.9",
|
|
64
|
-
"dpc-radar~=0.
|
|
65
|
-
"ispra-idrogeo~=0.
|
|
66
|
+
"dpc-radar~=0.6.0",
|
|
67
|
+
"ispra-idrogeo~=0.15.0",
|
|
66
68
|
]
|
|
67
69
|
docs = [
|
|
68
70
|
"zensical>=0.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "rainfall-thresholds"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.1"
|
|
4
4
|
description = "Rainfall intensity-duration thresholds for shallow landslides (Caine power law, frequentist fitting)"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
keywords = ["landslide", "rainfall threshold", "intensity-duration", "caine", "hydrology", "natural hazards", "italy", "italica"]
|
|
@@ -41,12 +41,14 @@ build-backend = "uv_build"
|
|
|
41
41
|
|
|
42
42
|
[dependency-groups]
|
|
43
43
|
dev = [
|
|
44
|
+
"jsonschema>=4.26.0",
|
|
44
45
|
"mcp>=2.3",
|
|
45
46
|
"mypy>=1.13",
|
|
46
47
|
"pytest>=8.3",
|
|
47
48
|
"pytest-asyncio>=0.24",
|
|
48
49
|
"pytest-cov>=6.0",
|
|
49
50
|
"ruff>=0.8",
|
|
51
|
+
"types-jsonschema>=4.26.0.20261006",
|
|
50
52
|
]
|
|
51
53
|
|
|
52
54
|
examples = [
|
|
@@ -55,8 +57,8 @@ examples = [
|
|
|
55
57
|
"matplotlib>=3.9",
|
|
56
58
|
# Only for notebooks/04: the sister libraries, joined in a notebook as Limen
|
|
57
59
|
# joins them. The package itself never imports them (tests/test_package.py).
|
|
58
|
-
"dpc-radar~=0.
|
|
59
|
-
"ispra-idrogeo~=0.
|
|
60
|
+
"dpc-radar~=0.6.0",
|
|
61
|
+
"ispra-idrogeo~=0.15.0",
|
|
60
62
|
]
|
|
61
63
|
|
|
62
64
|
docs = [
|
|
@@ -9,6 +9,8 @@ from rainfall_thresholds.assess import (
|
|
|
9
9
|
caine_excess,
|
|
10
10
|
cumulate,
|
|
11
11
|
event_against_threshold,
|
|
12
|
+
rain_to_threshold,
|
|
13
|
+
relative_total,
|
|
12
14
|
)
|
|
13
15
|
from rainfall_thresholds.events import (
|
|
14
16
|
RainfallEvent,
|
|
@@ -33,13 +35,17 @@ from rainfall_thresholds.regional import (
|
|
|
33
35
|
)
|
|
34
36
|
from rainfall_thresholds.sources import RainSource, point_series
|
|
35
37
|
from rainfall_thresholds.threshold import PowerLawThreshold
|
|
38
|
+
from rainfall_thresholds.trust import CALIBRATION, EXPECTED_BELOW, Calibration, calibration_of
|
|
36
39
|
|
|
37
40
|
__version__ = version("rainfall-thresholds")
|
|
38
41
|
|
|
39
42
|
__all__ = [
|
|
43
|
+
"CALIBRATION",
|
|
44
|
+
"EXPECTED_BELOW",
|
|
40
45
|
"ISTAT_REGIONS",
|
|
41
46
|
"ITALICA_T5",
|
|
42
47
|
"MACROREGIONS",
|
|
48
|
+
"Calibration",
|
|
43
49
|
"EventAssessment",
|
|
44
50
|
"PowerLawThreshold",
|
|
45
51
|
"RainSource",
|
|
@@ -55,6 +61,7 @@ __all__ = [
|
|
|
55
61
|
"api_kohler_linsley",
|
|
56
62
|
"auc",
|
|
57
63
|
"caine_excess",
|
|
64
|
+
"calibration_of",
|
|
58
65
|
"cumulate",
|
|
59
66
|
"cutoff_at_budget",
|
|
60
67
|
"event_against_threshold",
|
|
@@ -64,7 +71,9 @@ __all__ = [
|
|
|
64
71
|
"macroregion_of",
|
|
65
72
|
"percentile_of",
|
|
66
73
|
"point_series",
|
|
74
|
+
"rain_to_threshold",
|
|
67
75
|
"reconstruct_events",
|
|
76
|
+
"relative_total",
|
|
68
77
|
"skill",
|
|
69
78
|
"skill_at_budget",
|
|
70
79
|
"strongest_event",
|