Skip to content

Releases: cameronbracken/corehydro

v0.13.0 -- the TimeSeries container

Choose a tag to compare

@cameronbracken cameronbracken released this 28 Aug 09:17
v0.13.0
6ccdd88

The heavy TimeSeries container -- the last unported portable slice of Numerics, and the one
four other members were waiting on. Numerics/Data/Time Series/TimeSeries.cs (2,334 lines) and
its Series base are ported, along with a DateTime value type that stands in for
System.DateTime (a corehydro addition: the calendar is what the container is built on, and the
core takes no external dependency). This closes branch port-time-series.

Added

  • A time-series object in both packages. R gets time_series() and 28 ts_*() verbs over a
    corehydro_ts classed list; Python gets a TimeSeries class with the same operations as
    methods -- the shape distribution() / Distribution already established. Between them they
    reach the whole container: moving windows, cumulative sums and differences, the value
    transformations, missing-value replacement and interpolation, date filling, clipping, shifting,
    interval conversion, the summary and monthly statistics, the duration curve, the five block
    series (with ts_water_year() and ts_calendar_year() by name), peaks over threshold, seasonal
    decomposition, and two resamplers.
  • Dates are native in both languages. R takes and returns POSIXct in UTC and also accepts
    Date, ISO 8601 strings and epoch seconds; Python takes and returns numpy.datetime64 and also
    accepts datetime, a pandas DatetimeIndex, ISO strings and floats. Epoch seconds travel on
    the wire, never .NET ticks -- a tick count near 6.3e17 is not exactly representable in a double,
    while epoch seconds is exact for every interval the container supports.
  • A timeseries toolbox group, the nineteenth, plus four fixture files. One of them,
    fixtures/timeseries/date_time.json, is what puts the ported DateTime -- which has no
    upstream source file to be checked against -- permanently behind the dotnet oracle gate:
    AddMonths day-clamping, leap years, the fractional-AddDays split, DayOfYear, DayOfWeek
    and ToOADate.
  • Four members un-gated, each deferred with the container it needed: the seasonal
    PointProcessModel data path and GeneratePOTTimeSeries, DataFrame.CreateBlockSeries and
    CreatePeaksOverThresholdSeries (with ExactData.DateTime), and the ARIMAX covariate
    forecast-tail extension (CovariateExtension = "block_bootstrap" / "knn"). The seasonal point
    process is reachable from both packages: analysis_data() takes dated observations and
    model_point_process() takes seasonal / time_block / start_month.
  • autocorrelation() accepts a time series in both packages.

Fixed

  • The phase itself broke nothing and found four upstream behaviours instead (see below). The
    documentation sweep that closed it did find one thing: worked example 04 pinned map_fitness
    at 473.558409617748, the value from before the v0.2.0 upstream sync moved MAP fitness onto
    the log-likelihood scale as -473.558409617748. Both language pages were wrong and both
    pipelines were green, because Quarto's freeze keys on the source file rather than on the
    package the source calls, and notebooks are never re-executed. Every other page was audited by
    forced re-execution and reproduces.
  • The documentation had accumulated scope claims that stopped being true as v0.9.0 through
    v0.13.0 landed: five upstream example notebooks were still listed out of scope after being
    ported, Data.Statistics was marked partial when all thirteen of its classes are ported, and
    seven example pairs said capabilities were unreachable that mcmc_posterior(),
    autocorrelation(), ml_jenks_breaks(), summary_statistics() and correlation() have
    since made public.

Changed

  • HEC-FDA is no longer listed as a porting target. It is being ported separately in
    hecfda; the status page carries it as a related
    effort instead of a planned upstream source.
  • The rendered site output (219 files: the .html pages sitting beside their sources, their
    *_files/ figures, and site_libs/) is no longer tracked. site/_freeze still is.

Notes

  • Four upstream findings, each measured against the real compiled library, mirrored rather
    than corrected, and written up in docs/upstream-csharp-issues.md: CumulativeSum silently
    drops the series' time interval; three indexed math overloads reach through an index their own
    guard rejected while their seven siblings skip it; MovingAverage / MovingSum swap their
    ArgumentException arguments; and -- the consequential one -- PointProcessModel's seasonal
    day-of-year list comes out date-sorted while the likelihood pairs it positionally with the
    caller's unsorted exact series, so a record not already in date order has each magnitude scored
    against another event's day.
  • The Autocorrelation TimeSeries overloads are still not ported, and that is now a
    measurement rather than a severance.
    They are the same four bodies with a
    missing-value-skipping mean, and the difference is not observable, because the lag-0
    autocovariance sums over every observation. Driven against the real library, both overload
    families return identical values on a clean series and all-NaN on a gappy one.
  • A seeded resampling run is bit-identical between R and Python, and
    fixtures/timeseries/timeseries_cross_language.json asserts it at zero tolerance. Unlike the
    callback layer's honest limit, every operation here happens inside the shared core, so this is a
    guarantee rather than a best effort.

Both packages install from source and need a C++17 compiler.

pak::pak("cameronbracken/corehydro/corehydror@v0.13.0")
pip install "git+https://github.com/cameronbracken/corehydro.git@v0.13.0#subdirectory=corehydropy"

Validated against USACE-RMC Numerics 2.1.4 and RMC-BestFit 2.0.0. Full notes in
CHANGELOG.md;
documentation at https://cameronbracken.github.io/corehydro/.

v0.1.0-alpha

v0.1.0-alpha Pre-release
Pre-release

Choose a tag to compare

@cameronbracken cameronbracken released this 12 Jul 19:23
v0.1.0
7a1f785

Changelog

All notable changes to corehydro (the shared C++ core, the corehydror R package, and
the corehydropy Python package) are documented here. The format follows
Keep a Changelog, and the project uses
semantic versioning. The three components are versioned together.

Unreleased

0.1.0 - 2026-07-11

First tagged release. Everything below is new.

Added

  • Shared C++17 core with full parity to the USACE-RMC Numerics and RMC-BestFit C#
    libraries (the probability, estimation, and analysis layers): all 42 univariate
    distributions, multivariate distributions and seven bivariate copulas, eight MCMC
    samplers (RWMH, ARWMH, DEMCz, DEMCzs, HMC, NUTS, Gibbs, SNIS) with Gelman-Rubin and
    ESS diagnostics, bootstrap uncertainty, the MLE/MAP/Bayesian/GMM estimators, all
    RMC-BestFit model families (flood frequency, Bulletin 17C, mixtures, competing risks,
    point process, time series, spatial GEV, rating curves, bivariate/copula), the full
    Analyses layer, and the Diagnostics layer (leverage, PSIS-LOO influence, prior
    influence, predictive checks). See the porting status page for the exact scope.
  • R package corehydror and Python package corehydropy, thin bindings over
    the same compiled core. A bit-exact Mersenne Twister port means seeded results are
    identical across R, Python, and the upstream C# libraries.
  • Public distribution API: construct any of 38 families by name; density, CDF,
    quantile, moments, L-moments, log-likelihood, seeded random generation, and fitting
    by MLE, L-moments, or product moments.
  • Analysis functions (19 in each package): univariate_analysis,
    fit_distributions, bulletin17c_analysis, mixture/competing-risk/point-process/
    composite/spatial-GEV analyses, AR/MA/ARIMA/ARIMAX time-series analyses, bivariate
    and coincident-frequency analyses, rating curves, bootstrap uncertainty, predictive
    checks, and estimation diagnostics.
  • mcmc_sample(): direct MCMC over any distribution family (7 samplers) with
    chains, acceptance rates, MAP, posterior summaries, R-hat, and ESS.
  • Statistics utilities: Multiple Grubbs-Beck low-outlier test, Box-Cox and
    Yeo-Johnson transforms, plotting positions, Latin hypercube sampling.
  • Validation: a language-neutral oracle fixture suite consumed by C++, R, and
    Python runners, plus a dev-only dotnet gate that replays every fixture against the
    real C# libraries (4,100+ values reproduced, 0 failures).
  • Documentation site with worked examples in both languages ported from the
    official Numerics-Python-Examples repository (11 example pairs, each ending in an
    executable reproduction check against the upstream C# outputs), a Python API
    reference (quartodoc), an R API reference (pkgdown), and a porting status page.
  • Developer tooling: pixi environment with tasks mirroring the Makefile targets,
    GitHub Actions CI (3 OS matrix) and Pages deployment.

Changed

  • Renamed from bestfit (packages bestfitr/bestfitpy) to corehydro
    (corehydror/corehydropy), reflecting the goal of carrying code from both
    USACE-RMC and HEC libraries in one package family.