mostlyright 1.1.3 → 1.4.0

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.
package/dist/index.d.ts CHANGED
@@ -5,13 +5,15 @@ export { LiveStreamError, NoLiveDataError, SourceMismatchRole, helloCore } from
5
5
  import { Observation } from '@mostlyrightmd/weather';
6
6
  import * as weather from '@mostlyrightmd/weather';
7
7
  export { weather };
8
- export { LatestOptions, LiveObservation, LiveSource, LiveSourceTag, POLITE_FLOORS_S, SOURCE_IDENTITY_TAGS, SUPPORTED_SOURCES, StreamOptions, helloWeather, isLiveSource, latest, sourceTag, stream, validatePollSeconds, validateSource } from '@mostlyrightmd/weather';
8
+ export { DailyExtremeRow, DailyExtremesMergeMode, DailyExtremesOptions, LatestOptions, LiveObservation, LiveSource, LiveSourceTag, ObsOptions, ObsRow, ObsSourceFilter, ObsStrategy, POLITE_FLOORS_S, SOURCE_IDENTITY_TAGS, SUPPORTED_SOURCES, StreamOptions, dailyExtremes, helloWeather, isLiveSource, latest, obs, sourceTag, stream, validatePollSeconds, validateSource } from '@mostlyrightmd/weather';
9
9
  import * as markets from '@mostlyrightmd/markets';
10
10
  export { markets };
11
11
  export { helloMarkets } from '@mostlyrightmd/markets';
12
12
  import { CacheStore } from '@mostlyrightmd/core/internal/cache';
13
13
  import { PairsRow } from '@mostlyrightmd/core/internal/pairs';
14
14
  export { PairsRow } from '@mostlyrightmd/core/internal/pairs';
15
+ import * as preprocessing from '@mostlyrightmd/core/preprocessing';
16
+ export { preprocessing };
15
17
 
16
18
  /** The four mutually-exclusive selector names. */
17
19
  declare const SELECTOR_NAMES: readonly ["station", "city", "contract", "contracts"];
@@ -70,7 +72,56 @@ declare function annotateSettlesFor(station: string, city: string | null): reado
70
72
  */
71
73
  declare function buildOverrideWarning(contractStation: string, overrideStation: string): StationOverrideWarning;
72
74
 
73
- interface ResearchOptions {
75
+ /**
76
+ * Phase 21 21-01 composable-kwargs extension to `ResearchOptions`.
77
+ *
78
+ * All fields are optional; defaults match Python. Each field's runtime
79
+ * validation lives in `validateResearchKwargs()` so the failure surface is
80
+ * lockstep with Python's `_validate_research_kwargs`.
81
+ */
82
+ interface ResearchKwargsExtension {
83
+ /**
84
+ * When `true`, attach `fcst_*` columns. Phase 17 wired this end-to-end
85
+ * for IEM MOS; other forecast models require Phase 21 follow-up plans.
86
+ *
87
+ * Default: `false`.
88
+ */
89
+ include_forecast?: boolean;
90
+ /**
91
+ * Single forecast model name (e.g. `"gfs"`, `"nbm"`). Requires
92
+ * `include_forecast=true`. Mutually exclusive with `forecast_models`.
93
+ */
94
+ forecast_model?: string;
95
+ /**
96
+ * Multi-model forecast fan-out. Requires `include_forecast=true`.
97
+ * Mutually exclusive with `forecast_model`.
98
+ */
99
+ forecast_models?: ReadonlyArray<string>;
100
+ /**
101
+ * When `true`, run QC passes and surface QC columns. Default `false`.
102
+ */
103
+ qc?: boolean;
104
+ /**
105
+ * IANA timezone override for stations not in the canonical registry.
106
+ * Rarely needed for the 20-station Phase 1 set (all covered).
107
+ */
108
+ tz_override?: string;
109
+ /**
110
+ * D-03: accepted but no-op in TS. `backend="polars"` raises
111
+ * `DataAvailabilityError` (no Polars in browser/Node TS). Default
112
+ * `"pandas"` mirrors Python; in TS this is informational only.
113
+ */
114
+ backend?: "pandas" | "polars";
115
+ /**
116
+ * D-03: accepted but no-op in TS. Python returns a `MostlyRightResult`
117
+ * wrapper class when `return_type="wrapper"`; TS returns plain object
118
+ * arrays (no `.attrs` divergence to bridge), so the wrapper would carry
119
+ * no extra signal.
120
+ */
121
+ return_type?: "frame" | "wrapper";
122
+ }
123
+
124
+ interface ResearchOptions extends ResearchKwargsExtension {
74
125
  /** Forward to all underlying fetchers; aborts the whole pipeline. */
75
126
  signal?: AbortSignal;
76
127
  /** AWC lookback window in hours. Default 168 (AWC max). Clamped by the fetcher. */
@@ -290,6 +341,12 @@ declare function discover(args: {
290
341
  readonly city: string;
291
342
  }): DiscoverResult;
292
343
 
344
+ /**
345
+ * @deprecated Use the lowercase `preprocessing` namespace instead — it
346
+ * matches the Python `mostlyright.preprocessing` namespace. The
347
+ * PascalCase alias is scheduled for removal in v2.0.0.
348
+ */
349
+ declare const Preprocessing: typeof preprocessing;
293
350
  /**
294
351
  * Placeholder version string for the meta package. The authoritative
295
352
  * package version lives in `package.json#version` (currently
@@ -299,4 +356,4 @@ declare function discover(args: {
299
356
  */
300
357
  declare const version = "0.0.0";
301
358
 
302
- export { type DiscoverResult, type DiscoverRow, MODE2_SOURCES, type Mode2Source, type ResearchBySourceOptions, type ResearchOptions, SELECTOR_NAMES, SOURCE_ALIASES, type SelectorArgs, type SelectorName, type StationOverrideWarning, annotateSettlesFor, assertSourceIdentity, buildOverrideWarning, discover, isMode2Source, research, researchBySource, resolveCity, resolveContract, validateSelectors, version };
359
+ export { type DiscoverResult, type DiscoverRow, MODE2_SOURCES, type Mode2Source, Preprocessing, type ResearchBySourceOptions, type ResearchOptions, SELECTOR_NAMES, SOURCE_ALIASES, type SelectorArgs, type SelectorName, type StationOverrideWarning, annotateSettlesFor, assertSourceIdentity, buildOverrideWarning, discover, isMode2Source, research, researchBySource, resolveCity, resolveContract, validateSelectors, version };