v0.42.2
This is a re-release of v0.42.1, which didn't make it to PyPI. The release notes from v0.42.1 are copied below.
Features
- Add new
HistogramMatchingWithEckel
experimental humidity scaling model. This is still a work in progress. - Add new
Flight.fit_altitude
method which uses piecewise linear fitting to smooth a flight profile. - Add new
pycontrails.core.flightplan
module for parsing ATC flight plans between string and dictionary representations. - Add new airports and flightplan examples.
Breaking changes
- No longer attach empty fields "sdr", "rsr", "olr", "rf_sw", "rf_lw", "rf_net" onto the
source
parameter inCocip.eval
when the flight doesn't generate any persistent contrails. - Remove params
humidity_scaling
,rhi_adj_uncertainty
, andrhi_boost_exponent_uncertainty
fromCocipUncertaintyParams
. - Change the default value for
parallel
from True to False inxr.open_mfdataset
. This can be overridden by setting thexr_kwargs
parameter inERA5.open_metdataset
.
Fixes
- Fix a unit test (
test_dtypes.py::test_issr_sac_grid_output
) that occasionally hangs. There may be another test intest_ecmwf.py
that suffers from the same issue. - Fix issue encountered in
Cocip.eval
when concatenating contrails with inconsistent values for_out_of_bounds
. This is only relevant when running the model with the experimental parameterinterpolation_use_indices=True
. - Add a
Fleet.max_distance_gap
property. The previous property on theFlight
class was not applicable toFleet
instances. - Fix warning in
Flight
class to correctly suggest adding kwargdrop_duplicated_times
. - Fix an issue in the
VectorDataset
constructor with adata
parameter of typepd.DataFrame
. Previously, time data was rewritten to the underlying DataFrame. This could cause copy-on-write issues if the DataFrame was a view of another DataFrame. This is now avoided.
Internals
- When possible, replace type hints
np.ndarray
->np.typing.NDArray[np.float_]
in thecocip
,cocip_params
,cocip_uncertainty
,radiative_forcing
, andwake_vortex
modules. - Slight performance enhancements in the
radiative_forcing
module. - Change the default value of
u_wind
andv_wind
from None to 0 inFlight.segment_true_airspeed
. This makes more sense semantically.