Changelog¶
0.60.0¶
Features¶
Add a datalib to support ICON forecast access via the DWD Open Data Server. See the ICON notebook for usage examples.
Internals¶
Add
"DWD"as a recognized meteorology provider and"ICON","ICON-EU", and"ICON-D2"as recognized meteorology datasets inmet.py.Add geometric vertical velocity as a new generic
MetVariable.Modify
metsource.parse_timestepsto accept a new optionalshiftargument. This argument can be used to makemetsource.parse_timestepsreturn times that are not even multiples offreq(e.g., six-hourly timesteps starting at 3Z). The behavior ofmetsource.parse_timestepsis unchanged if this argument is omitted.Extract some utilities for ECMWF model-to-pressure-level conversion to a more flexible (less ECMWF-specific)
met_utils.ml_to_plfunction and a newutils.arraysmodule. The updated utilities include some minor behavioral changes to improve handling of nan values.Add utilities for running coroutines sychronously.
Register
pytest.mark.unreliableto mark unreliable tests (e.g., tests vulnerable to upstream changes in an external service). These tests are skipped in the release workflow.Skip tempfile removal in
temp.pyutility module when the temporary file does not exist.
0.59.1¶
Features¶
Fixes¶
Correct conditional logic in
thermo._e_sat_piecewiseto preventthermo.q_satfrom returningnp.nanfor temperatures below freezing (0°C).Update doctests for compatibility with
float32ERA5 variables.
Internals¶
Open the backdoor to running
Cocipwith a fuel-varyingFleet. This is not officially supported and requires some undocumented monkey-patching.Specify
join="outer"andcompat="no_conflicts"when opening multiple netCDF files inmetsource.open_mfdatasetto avoid xarrayFutureWarning.Update cached doctest data in
gs://contrails-301217-unit-test/doc-test-cachewith current output from theERA5datalib. This data now containsfloat32rather thanfloat64variables. Old doctest data is archived ings://contrails-301217-unit-test/doc-test-cache-v0.59.0.Include additional fields in the ICAO EDB static files. For example, MEEM2 utilizes a fifth data point (maximum nvPM EI) to construct the nvPM emissions profile.
Major re-structuring and clean-up of the emissions module to improve intuitiveness and standardize terminology.
0.59.0¶
Features¶
Add lightweight
GRUANdatalib for accessing GRUAN radiosonde data via FTP. See the GRUAN notebook for usage examples.
Breaking changes¶
Updated error handling in
goes.gcs_goes_pathto raise aFileNotFoundErrorif any of the requested bands are not available. Previous versions raised aRuntimeErroronly in cases where no requested bands were available.
Fixes¶
Ensure call to
np.clipincontrail_properties.initial_ice_particle_numberis backwards compatible with numpy < 2.1.
0.58.0¶
Features¶
Build wheels for python 3.14. These are not yet tested in the CI (not all dependencies support python 3.14 yet).
Breaking changes¶
Drop support for python 3.10 per NEP 29.
Require scipy >= 1.12 to better support the
PycontrailsRegularGridInterpolatorinterface.
Fixes¶
When instantiated with
copy=True,MetDatasetandMetDataArraynow remove duplicate dimension values, preserving only the first occurrence of each. Previously, duplicates were silently retained (such duplicates are not expected with typical gridded weather data). Withcopy=False, aValueErroris raised if duplicate dimension values are present.Update
PycontrailsRegularGridInterpolatorfor improved compatibility withscipy.interpolate.RegularGridInterpolator. All methods now delegate to SciPy’s implementation, except formethod="linear", which retains a fast-path optimized inPycontrailsRegularGridInterpolator.
0.57.0¶
Features¶
Add new
Himawariinterface for downloading, processing, and visualizing Himawari-8 and Himawari-9 imagery. See the Himawari notebook for usage examples.
Breaking changes¶
Deprecate the
channelsparameter inGOES.__init__in favor ofbands, aligning with the newHimawariinterface. Thechannelsparameter is still available as an alias forbands, but will be removed in a future release.Deprecate the
goes_bucketparameter inGOES.__init__in favor ofbucket, aligning with the newHimawariinterface. Thegoes_bucketparameter is still available as an alias forbucket, but will be removed in a future release.
Internals¶
Add a new
pycontrails.datalib.geo_utilsmodule with tools for working with geostationary satellite imagery. This module currently includes functions previously defined in thegoesmodule, but are also applicable to Himawari imagery.Rename
goes.extract_goes_visualization->goes.extract_visualizationfor consistency with the newhimawarimodule. The old name is still available as an alias.Localize the
cartopyimport to theextract_visualizationfunction within thegoesmodule. This allows the user to downloadGOESimagery without havingcartopyinstalled.Tweak some of the internal logic in
GOES.getto slightly improve performance and readability, and to avoid loading unnecessary cached data into memory.Replace
boto3withs3fsin thegfsmodule.
0.56.0¶
Features¶
Improve the accuracy of overlaying flight tracks and contrails on Landsat and Sentinel imagery. This includes:
A new
correctionmodule to align vectorized aircraft data with satellite imagery using sensing-angle (parallax error) and scan-time corrections. Naively overlaying ADS-B data results in errors of several kilometers; with this correction, typical errors are reduced to a few hundred meters.An updated
Sentinelinterface for parsing metadata required for overlay correction (see the newsentinel_metadatamodule for low-level details). This includes a newcolocate_flightmethod to overlay flight tracks on Sentinel-2 imagery.A new
landsat_metadatamodule for parsing Landsat metadata required for overlay correction (not exposed within theLandsatdatalib).A new
open_landsat_metadatafunction for accessing the USGS Bulk Metadata service.
Update the Sentinel notebook to demonstrate the new overlay correction functionality available in the
Sentineldatalib.
Fixes¶
Fix the
Flight.to_geojson_multilinestringmethod to handle flights without an “altitude” field.
Internals¶
Update the
Landsatdatalib documentation to describe current limitations. TheLandsatdatalib should be considered legacy and may be replaced in future releases.
0.55.0¶
Features¶
Add new
pycontrails.models.extended_k15module for modeling volatile particulate matter (vPM) activation in aircraft plumes. This module implements the extended K15 model introduced by Ponsonby et al..Introduce basic support for vPM activation within the
CocipandCocipGridmodels. This support is experimental and can be enabled via thevpm_activationparameter.
Internals¶
Refactor
contrail_properties.initial_ice_particle_numberto integrate more smoothly with the vPM activation model. The function’s signature has been updated, but its underlying behavior is unchanged. In particular, this has no effect on theCocipmodel whenvpm_activationis disabled.
0.54.12¶
Breaking changes¶
Update the formula used to compute the saturation vapor pressure over liquid water from Sonntag (1994) to Murphy and Koop (2005). This improves consistency with Ponsonby et al.. Minor numerical differences may appear in models that depend on the saturation vapor pressure over liquid water (for example, applications involving the Schmidt-Appleman criterion). Users who wish to supply their own saturation vapor pressure function can monkey-patch
thermo.e_sat_liquidandthermo.e_sat_liquid_prime.
Internals¶
Consolidate several
pycontrails.utils.typestype variables to speed up type checking. This has no effect on runtime behavior.
0.54.11¶
Features¶
Add new
timestepsparameter to theDryAdvectionmodel. If provided, this parameter overrides the timesteps computed by the model. Providingtimestepsand setting themax_ageparameter toNoneallows the model to advect all waypoints to the specified times. This is useful for running advection simulations over a fixed time period rather than to a fixed age. Thetimestepsparameter is optional and defaults toNone, in which case the model behaves as before.Add new
timeparameter toFlight.resample_and_fill. If provided, flights will be resampled to times intimerather than to times computed based onfreq. Thetimeparameter is optional and defaults toNone, in which caseFlight.resample_and_fillbehaves as before.
Fixes¶
Fix the
GOESinterface caching mechanism when a customgoes_bucketis provided. This allows users to cache both GOES-16 and GOES-18 data without conflicts.Officially support the “scda” HRES stream (useful for forecast reference times 06Z and 18Z). Previously, this was implicitly assumed.
Fix an issue with how the
parse_atc_planmethod handles newline characters in the flightplan string.Fix an issue with the
DryAdvection.evalimplementation in which a large temporal gap between waypoints caused the model to end prematurely.Fix the error message emitted by
ACCF.evalif theclimaccfpackage is not installed. (Theclimaccfpackage can be installed withpip install git+https://github.com/dlr-pa/climaccf.git.)
Internals¶
Support PEP 639.
Support ruff 0.12.0.
Remove the
dep_licenseoptional dependency from thedevextras.
0.54.10¶
Features¶
Output from the
DryAdvectionmodel will include aflight_idcolumn when run with aFlightor aFleet.
Fixes¶
GOES data download for GOES-East now supports the GOES-16 -> GOES-19 transition. The default GCS bucket is automatically selected based on the requested date (using 2025-04-04 as the cutoff). For pre-transition data, this change is backwards compatible with previous versions of pycontrails.
Pass the
GOES.fsinstance to thegcs_goes_pathfunction from theGOES.gcs_goes_pathmethod to avoid repeated GCS file system client instantiation.
Internals¶
Fix errors in “See Also” sections of
Modeldocstrings.
0.54.9¶
Features¶
Include new
goes.correct_parallaxfunction in theGOESdatalib to correct for parallax artifacts in GOES imagery. This function can be used to better superimpose flight and contrail data over GOES imagery.
Breaking changes¶
Air temperature is now an optional met variable in
PSFlight. Code that usesPSFlight.met_variablesmay need to be updated.The
ensure_true_airspeed_on_sourcemethod of theAircraftPerformanceclass now operates fully in-place and no longer returns a value. Code that relies on a return value may need to be updated.The
PSFlight.eval_flightmethod now retrieves all inputs to performance calculations from theFlightparameter rather than thePSFlightmodel source. Code may need to be updated if constants foraircraft_mass,thrust,engine_efficiency, orfuel_flowwere stored as attributes in aFleet, as these attributes are lost when aFleetis converted to aFlightlist prior to callingeval_flight.
Internals¶
Define
default_parameters,met_variables, andoptional_met_variablesfor theAircraftPerformanceabstract base class.Remove the definitions of
met_variablesandoptional_met_variablesfromPSFlight. These are now inherited fromAircraftPerformance.Retrieve aircraft mass, thrust, engine efficiency, and fuel flow from
Flightparameter rather than model source inPSFlight.eval_flight.Automatically run the pycontrails-bada test workflow after publishing pycontrails release to PyPI.
0.54.8¶
Features¶
Update the Poll-Schumann Aircraft Performance model:
Support the Support Boeing 737 MAX 10 aircraft type.
Update aircraft maximum landing weight, maximum zero fuel weight, operating empty weight, and maximum payload within the static CSVs for existing aircraft types as recommended by Ian Poll.
Add
ExponentialBoostLatitudeCorrectionHumidityScalingcalibrated for model-level ERA5 data.
Internals¶
Update the
pycontrails.physics.staticCSV files to include newly released global and regional passenger and cargo load factor data from IATA (Oct-2024 to Dec-2024).Attach
n_ice_per_m_0andf_survto the downwash flight computed in theCocipruntime. This data is now saved as part of theCocipoutput.Rename and modify
contrail_properties.ice_particle_numbertocontrail_properties.initial_ice_particle_number.Rename
ValidateTrajectoryHandler.CRUISE_ROCD_THRESHOLD_FPS->ValidateTrajectoryHandler.ROCD_THRESHOLD_FPS. Update its value from 4.2 ft/sec -> 83.25 ft/sec.Remove the altitude filter on the
ValidateTrajectoryHandlerROCD check. Now all waypoints are checked for ROCD violations.Correctly parse “DOF” (departure date) field from flight plan in the
flightplanmodule.
v0.54.7¶
Features¶
Add helper
classmethodstoModel,Cocip, andCocipGridfor generating lists of required variables from specific data sources.Add a
ValidateTrajectoryHandlerto thespiremodule to validate spire ADS-B data. This work is experimental and will be improved in future releases.Update Unterstrasser (2016)’s parameterised model of the contrail ice crystal survival fraction to the latest version (Lottermoser & Unterstrasser, 2025). This update:
improves the goodness of fit between the parameterised model and LES, and
expands the parameter space for application to very low and very high nvPM inputs, different fuel types (where the EI H2Os are different), and higher ambient temperatures (up to 235 K) to accommodate for contrails formed by liquid hydrogen aircraft.
Breaking changes¶
The
MetDataset.standardize_variablesmethod now returns a newMetDatasetrather than modifying the existing dataset in place. To retain the previous behavior, useMetDataset.standardize_variables(..., inplace=True).
Fixes¶
Change naming convention for eastward and northward wind fields in
AircraftPerformancemodels for consistency with theCocipandDryAdvectionmodels. Fields on thesourceare now namedu_windandv_windinstead ofeastward_windandnorthward_wind. Under some paths of computation, this avoids a redundant interpolation.Fix the
AircraftPerformance.ensure_true_airspeed_on_sourcemethod in the case when themetattr is None and thefill_with_groundspeedparameter is enabled.
Internals¶
Make
pycontrailscompatible withpandas 2.0andpandas 2.1.Avoid auto-promotion of float32 to float64 within the
Emissionsmodel run-time.Add convenience
VectorDataset.get_constantmethod.
v0.54.6¶
Features¶
Add support for generic (model-agnostic) meteorology data to
CocipandCocipGrid.Add two new parameters to the
DryAdvectionmodel.If the
verbose_outputsparameter is enabled, additional wind-shear data is included in the output.If the
include_source_in_outputparameter is enabled, the source data with any of the intermediate artifacts (e.g., interpolated met data, wind-shear data, etc.) is included in the output.
Both parameters are disabled by default.
Fixes¶
Update the CDS URL referenced throughout pycontrails from
https://cds-beta.climate.copernicus.eutohttps://cds.climate.copernicus.eu.
Internals¶
Suppress mypy
return-valueerrors for functions ingeo.pywhere mypy fails to correctly infer return types of numpy ufuncs applied to xarray objects.Change
AircraftPerformanceand downstream implementations for better support in running overFleetsources. The runtime ofPSFlightremains the same.
v0.54.5¶
Features¶
This release brings a number of very minor performance improvements to the low-level pycontrails data structures (
VectorDatasetandMetDataset). Cumulatively, these changes should bring in a small but nontrivial speedup (~5%) when running a model such asCociporDryAdvectionon a singleFlightsource.Core
Flightmethods such ascopy,filter, anddownselect_metare now ~10x faster for typical use cases.Converting between
FleetandFlightinstances viaFleet.from_seqandFleet.to_flight_listare also ~5x faster.
Implement low-memory met-downselection logic in
DryAdvection. This is the same logic used inCocipGridto reduce memory consumption by only loading the necessary time slices of themetdata into memory. Ifmetis already loaded into memory, this change will have no effect.
Breaking Changes¶
Remove the
copyparameter fromGeovectorDataset.downselect_met. This method always returns a view of the original dataset.Remove the
validateparameter in theMetDataArrayconstructor. Input data is now always validated.
Fixes¶
Make slightly more explicit when data is copied in the
VectorDatasetconstructor: data is now always shallow-copied, and thecopyparameter governs whether to copy the underlying arrays.Call
downselect_metinDryAdvection.eval. (This was previously forgotten.)Fix minor bug in
CocipGriddownselect met logic introduced in v0.54.4. This bug may have caused some met slices to be reloaded when runningCocipGrid.evalwith lazily-loadedmetandraddata.
Internals¶
Add internal
VectorDataset._from_fastpathandMetDataset._from_fastpathclass methods to skip data validation.Define
__slots__onMetBase,MetDataset,MetDataArray, andAttrDict.When
MetDatasetandMetDataArrayshared a common implementation, move the implementation toMetBase. This was the case for thecopy,downselect, andwrap_longitudemethods.
v0.54.4¶
Features¶
Improve the
_altitude_interpolationfunction used withinFlight.resample_and_filland ensure that it is consistent with the existing GAIA publication The function_altitude_interpolationnow accounts for various scenarios. For example:Flight will automatically climb to an assumed cruise altitude if the first and next known waypoints are at very low altitudes with a large time gap.
If there are large time gaps between known waypoints with a small altitude difference, then the flight will climb at the mid-point of the segment.
If there are large time gaps and positive altitude difference, then the flight will climb at the start of its interpolation until the known cruising altitude and start its cruise phase.
If there are large time gaps and negative altitude difference, then the flight will continue cruising and only starts to descend towards the end of the interpolation.
If there is a shallow climb (ROCD < 500 ft/min), then always assume that the flight will climb at the next time step.
If there is a shallow descent (-250 < ROCD < 0 ft/min), then always assume that the flight will descend at the final time step.
Conditions (3) to (6) are based on the logic that the aircraft will generally prefer to climb to a higher altitude as early as possible, and descend to a lower altitude as late as possible, because a higher altitude can reduce drag and fuel consumption.
Breaking changes¶
Remove the optional input parameter
climb_descend_at_endinFlight.resample_and_fill. See the description of the new_altitude_interpolationfunction for the rationale behind this change.Remove the
copyargument fromFleet.from_seq. This argument was redundant and not used effectively in the implementation. TheFleet.from_seqmethod always returns a copy of the input sequence.
Fixes¶
Fix the
ERA5interface when making a pressure-level request with a single pressure level. This change accommodates CDS-Beta server behavior. Previously, a ValueError was raised in this case.Bypass the ValueError raised by
dask.array.gradientwhen the input array is not correctly chunk along the level dimension. Previously,Cocipwould raise an error when computing tau cirrus in the case that themetdata had single chunks along the level dimension.Fix the
CocipGridmet downselection process to accommodate cases wheredt_integrationis as large as the time step of the met data. Previously, due to out-of-bounds interpolation, the output ofCocipGrid(met=met, rad=rad, dt_integration="1 hour")was zero everywhere when themetandraddata had a time step of 1 hour.By default, don’t interpolate air temperature when running the
DryAdvectionmodel in a point-wise manner (no wind-shear simulation).Use native python types (as opposed to
numpyscalars) in thePSAircraftEngineParamsdataclass.Ensure the
PSGridmodel maintains the precision of thesource. Previously, float32 precision was lost per NEP 50.Fix
Fleet.resample_and_fillwhen the the “flight_id” field is included onFleet.data(as opposed toFleet.fl_attrs). Previously, this would raise a ValueError.Use the supplied
nominal_rocdparameter inFlight.resample_and_fillrather thanconstants.nominal_rocd(the default value of this parameter).
Internals¶
Add new
AdvectionBuffersdataclass to override the zero-like values used inModelParamswith the buffer previously used inCocipParams. This is now a base class forCocipParamsandDryAdvectionParams. In particular, theDryAdvectionnow uses nonzero values for the met downselect buffers.Change the order of advected points returned by
DryAdvectionto be consistent with the input order at each time step.Add the
RUFruleset for linting and formatting the codebase.Update type hints for
numpy2.2 compatibility. Additional changes may be required after the next iteration of thenumpy2.2 series.Relax the tolerance passed into
scipy.optimize.newtoninps_nominal_gridto avoid some convergence warnings. (These warnings were more distracting than informative.)Remove the
_verify_altitudecheck inFlight.resample_and_fill. This was often triggered by a flight with corrupt waypoints (ie, independent from the logic inFlight.resample_and_fill).
v0.54.3¶
Breaking changes¶
Update the default load factor from 70% to 83% to be consistent with historical data. This is used whenever an aircraft performance model is run without a specified load factor.
By default, the
CocipGrid.create_sourcestatic method will return latitude values from -90 to 90 degrees. This change is motivated by the new advection scheme used near the poles. Previously, this method returned latitude values from -80 to 80 degrees.
Features¶
Create new function
ps_grid.ps_nominal_optimize_machwhich computes the optimal mach number given a set of operating conditions.Add a new
jet.aircraft_load_factorfunction to estimate aircraft (passenger/cargo) load factor based on historical monthly and regional load factors provided by IATA. This improves upon the default load factor assumption. Historical load factor databases will be continuously updated as new data is released.Use a 2D Cartesian-like plane to advect particles near the poles (>80° in latitude) to avoid numerical instabilities and singularities caused by convergence of meridians. This new advection scheme is used for contrail advection in the
Cocip,CocipGrid, andDryAdvectionmodels. See thegeo.advect_horizontalfunction for more details.
Fixes¶
Ensure the fuel type is preserved when calling
Flight.resample_and_fill.Update the CLIMaCCF dependency to pull the head of the main branch in CLIMaCCF. Update the installation instructions.
Update the
ACCFParams.forecast_stepto None, which allows CLIMaCCF to automatically determine the forecast step based on themetdata.Update the
ACCFNOx parameter for the latest CLIMaCCF version.Ensure a custom “horizontal_resolution” param passed into
ACCFis not overwritten.Remove duplicated variable in
ACCF.met_variables.Allow the
ACCFmodel to accept relative humidity as a percentage or as a proportion.Include
ecmwf.RelativeHumidityinACCF.met_variablesso thatERA5(..., variables=ACCF.met_variables)no longer raises an error.
Internals¶
Improve computation of mach limits to accept vectorized input/output.
Test against python 3.13 in the GitHub Actions CI. Use python 3.13 in the docs and doctest workflows.
Publish to PyPI using trusted publishing.
Update
pycontrails-badainstallation instructions. Installpycontrails-badafrom GCP artifact repository in the test workflow.Floor the pycontrails version when running the docs workflow. This ensures that the hosted documentation references the last stable release.
Update literature and bibliography in the documentation.
Move the
engine_deterioration_factorfromPSFlightParamstoAircraftPerformanceParamsso it can be used by both the PS model and BADA.Include
engine_deterioration_factorinAircraftPerformanceGridParams.
v0.54.2¶
Features¶
Add
cache_downloadparameter to theGFSForecastinterface. When set toTrue, downloaded grib data is cached locally. This is consistent with the behavior of theERA5ModelLevelandHRESModelLevelinterfaces.
Fixes¶
Update GFS variable names “uswrf” -> “suswrf” and “ulwrf” -> “sulwrf”. This accommodates a breaking change introduced in eccodes 2.38.
Internals¶
Remove
overridesdependency. Requiretyping-extensionsfor python < 3.12.Upgrade some type hints for more modern python language features.
v0.54.1¶
Features¶
Add CoCiP Grid notebook example to documentation.
Implement
PSFlight.evalon aFleetsource.
Breaking changes¶
Remove
attrs["crs"]usage fromGeoVectorDatasetand child classes (Flight,Fleet). All spatial data is assumed to be EPSG:4326 (WGS84). This was previously assumed implicitly, but now thecrsattribute is removed from theattrsdictionary.Change the return type of
GeoVectorDataset.transform_crsto a pair of numpy arrays representingxandycoordinates in the target CRS.Remove deprecated
MetDataset.variablesproperty in favor ofMetDataset.indexes.Remove
**kwargsinMetDataArrayconstructor.Rename
ARCOERA5toERA5ARCOfor consistency with theERA5andERA5ModelLevelinterfaces.
Fixes¶
Fix the integration time step in
CocipGrid.calc_evolve_one_step. The previous implementation assumed a time interval ofparams["dt_integration"]. This may not be the case for allsourceparameters (for example, this could occur if runningCocipGridover a collection of ADS-B waypoints).Raise an exception in constructing
MetDataset(ds, copy=False)whends["level"]has float32 dtype. Per interpolation conventions, all coordinate variables must have float64 dtype. (This was previously enforced in longitude and latitude, but was overlooked in the level coordinate.)Allow
AircraftPerformance.ensure_true_airspeed_on_sourceto useeastward_windandnorthward_windfields on thesourceif available. This is useful when thesourcehas already been interpolated to met data.
v0.54.0¶
Features¶
Perform model-level to pressure-level conversion in-house instead of relying on
metview. This update has several advantages:The
ARCOERA5andERA5ModelLevelinterfaces no longer requiremetviewto be installed. Similarly, grib files and the associated tooling can also largely be avoided.The computation is performed using
xarrayanddasktooling, which means the result can be computed lazily if desired.The computation is defined using
numpyoperations (some of which release the GIL) and can be parallelized using threading throughdask(this is the default behavior).The computation is generally a bit faster than the
metviewimplementation (this depends on the exact chunking of the model level meteorology data). This chunking can be tuned by the user to optimize runtime performance or memory usage.
See the
ml_to_plfunction for low-level details.Update the
ARCOERA5andERA5ModelLevelinterfaces to use the new model-level to pressure-level conversion. The ERA5 model level data is now downloaded as the netcdf format instead of grib. This format change decreases the download size.
Breaking changes¶
Rename
levels->model_levelsin theARCOERA5andERA5ModelLevelconstructors. Renamecache_grib->cache_download.Rename
pressure_levels_at_model_levels->model_level_reference_pressure. Add a newmodel_level_pressuremethod that requires surface pressure data.
Fixes¶
Update
ERA5ModelLevelfor the new CDS-Beta server.
Internals¶
Use
ruffto format the codebase in place ofblack.Run
rufflinting and formatting over the notebook examples in the documentation.Update development documentation with new links.
v0.53.1¶
Features¶
Support
ERA5downloads from CDS-Beta. The updated interface is backwards compatible with the legacy CDS server. The choice of CDS server is governed by theurlparameter in theERA5constructor.
v0.53.0¶
Breaking changes¶
Drop python 3.9 support per NEP 29.
Features¶
Build wheels for python 3.13. (These wheels are available on PyPI, but other pycontrails dependencies may not yet support python 3.13.)
Fixes¶
Fix
PycontrailsRegularGridInterpolatorfor compatibility with the latest scipy version.
Internals¶
Defer import of
skimageandrasterio.
v0.52.3¶
Features¶
Add experimental
preprocess_lowmemparameter toCocip. When set toTrue,Cocipwill attempt to reduce memory consumption during flight preprocessing and initial formation/persistence calculations by using an alternate implementation ofMetDataArray.interpolate(see below).Add
lowmemkeyword-only argument toMetDataArray.interpolate. WhenTrue, attempt to reduce memory consumption by using an alternative interpolation strategy that loads at most two time steps of meteorology data into memory at a time.
Fixes¶
Defer import of
matplotlibinmodels.cocip.output_formats.Fix bug in
PycontrailsRegularGridInterpolatorthat caused errors when dispatching to 1-d linear interpolation from inrgi_cython.pyx.
Internals¶
Implement low-memory paths in
Cocip.evalandMetDataArray.interpolate.
v0.52.2¶
Breaking changes¶
Flight antimeridian crossings are now detected based on individual flight segments rather than minimum and maximum longitude values. This allows for correct detection of antimeridian crossings for flights that span more than 180 degrees longitude, and may change the output of
Flight.resample_and_fillfor such flights.
Features¶
Add experimental
fill_low_alt_with_isa_temperatureparameter on theAircraftPerformancebase class. When set toTrue, aircraft performance models withFlightsources will fill points below the lowest altitude in themet["air_temperature]data with the ISA temperature. This is useful when the met data does not extend to the surface. In this case, we can still estimate fuel flow and other performance metrics through the entire climb phase. By default, this parameter is set toFalse.Add experimental
fill_low_altitude_with_zero_windparameter on theAircraftPerformancebase class. When set toTrue, aircraft performance models will estimate the true airspeed at low altitudes by assuming the wind speed is zero.Add convenience
Flight.plot_profilemethod.
Fixes¶
Fix missing
Fuel Flow Idle (kg/sec)value in the1ZM001engine in theedb-gaseous-v29b-engines.csv.Fix the
step_thresholdinFlight._altitude_interpolation. This correction is only relevant when passing in a non-default value forfreqinFlight.resample_and_fill.Fix the
VectorDataset.__eq__method to check for the same keys. Previously, if the other dataset had a superset of the instance keys, the method may still returnTrue.Fix minor bug in
cocip.output_formats.radiation_time_slice_statisticsin which the function previously threw an error ift_enddid not directly align with the time index in theraddataset.Remove the residual constraint in
cocip.output_formats.contrails_to_hi_res_gridused during debugging.Improve detection of antimeridian crossings for flights that span more than 180 degrees longitude.
Internals¶
Improve the runtime performance of
Fleet.to_flight_list. For a largeFleet, this method is now 5x faster.Improve the runtime performance and memory footprint of
Cocip._bundle_results. When runningCocipwith a largeFleetsource,Cocip.evalis now slightly faster and uses much less memory.
v0.52.1¶
Breaking changes¶
Remove
lock=Falseas a default keyword argument toxr.open_mfdatasetin theMetDataSource.open_datasetmethod. This reverts a change from v0.44.1 and prevents segmentation faults when using recent versions of netCDF4 (1.7.0 and above).GOES imagery is now loaded from a temporary file on disk rather than directly from memory when using
GOES.getwithout a cachestore.
Internals¶
Remove upper limits on netCDF4 and numpy versions.
Remove h5netcdf dependency.
Update doctests with numpy 2 scalar representation (see NEP 51). Doctests will now fail when run with numpy 1.
Run certain tests in
test_ecmwf.pyandtest_met.pyusing the single-threaded dask scheduler to prevent tests from hanging while waiting for a lock that is never released. (This issue was encountered previously, and removinglock=FalseinMetDataSource.open_datasetreverts the fix.)Document pycontrails installation from conda-forge.
Fixes¶
Ensure the
MetDatasetvertical coordinates"air_pressure"and"altitude"have the correct dtype.
v0.52.0¶
Breaking changes¶
The
_antimeridian_indexhelper method in theflightmodule now returns a list of integers rather than an integer. This allowsFlight.to_geojson_multilinestringto support multiple antimeridian crossings (see below).
Features¶
Add tools for running APCEMM from within pycontrails. This includes:
utilities for generating APCEMM input files and running APCEMM (
pycontrails.models.apcemm.utils)an interface (
pycontrails.models.apcemm.apcemm) that allows users to run APCEMM as a pycontrailsModel.
Add prescribed sedimentation rate to
DryAdvectionmodel.Add
LandsatandSentineldatalibs for searching, retrieving, and visualizing Landsat 8-9 and Sentinel-2 imagery. The datalibs include:Tools for querying Landsat and Sentinel-2 imagery for intersections with user-defined regions (
landsat.query,sentinel.query) or flights (landsat.intersect,sentinel.intersect). These tools use BigQuery tables and require a Google Cloud Platform account with access to the BigQuery API.Tools for downloading and visualizing imagery from Landsat (
Landsat) and Sentinel-2 (Sentinel). These tools retrieve data anonymously from Google Cloud Platform storage buckets and can be used without a Google Cloud Platform account.
Add tutorial notebooks demonstrating how to use
LandsatandSentineldatalibs to find flights in high-resolution satellite imagery.Modify
Flight.to_geojson_multilinestringto make grouping key optional and to support multiple antimeridian crossings.Update the
pycontrailsbuild system to requirenumpy 2.0per the official numpy guidelines. Note that the runtime requirement forpycontrailsremainsnumpy>=1.22.Update
pycontrailsfor breaking changes introduced innumpy 2.0(e.g., NEP 50). All changes are backward compatible withnumpy>=1.22.
Fixes¶
Ensure width and depth are never attached to
DryAdvectionsource when running pointwise-only model.Ensure that azimuth is not dropped when present in
DryAdvectioninput source.Exclude netCDF version 1.7.0, which causes non-deterministic failures in unit tests primarily due to segmentation faults.
Pin numpy to 1.x in runtime dependencies until a working numpy 2.x-compatible netCDF4 release is available.
Internals¶
Create unit tests for the
APCEMMinterface that run if anAPCEMMexecutable is found on thePATHinside a clean APCEMM git repository with a pinned git hash. These tests will be skipped unless users carefully configure their local test environment and will not run in CI.Exclude APCEMM tutorial notebook from notebook tests.
Add unit tests for Landsat and Sentinel search tools and datalibs, but disable any tests that retrieve imagery data when running tests in GitHub Actions to limit resource consumption in GitHub runners. Users can disable these units tests locally by setting the environment variable
GITHUB_ACTIONS=true.Ensure
GITHUB_ACTIONSenvironment variable is available when building and testing wheels on linux.Skip cells that retrieve imagery data when running tests on Landsat and Sentinel tutorial notebooks.
Add tests for
Flight.to_geojson_multilinestringwith grouping key omitted and update tests with multiple antimeridian crossings.Minimum pandas version is bumped to 2.2 to ensure the the
include_groupskeyword argument used inFlight.to_geojson_multilinestringis available.Upgrade minimum
mypydependencies
v0.51.2¶
Features¶
Add functionality to automatically compare simulated contrails from
cocip.Cocipwith GOES satellite imagery (compare_cocip_with_goes).
Internals¶
Fix documentation build in CI.
v0.51.1¶
Breaking changes¶
Average fuel burn in the PS model is increased by 2.5% unless
engine_deterioration_factoris overriden.
Features¶
PS model: Support four aircraft types, including
E75L,E75S,E290, andE295.PS model: Integrate
ps_synonym_listto increase PS model aircraft type coverage to 102.PS model: Account for increase in fuel consumption due to engine deterioration between maintenance cycle.
Internals¶
Calculate rate of climb and descent (ROCD) using hydrostatic equation to improve accuracy.
PS model: Move engine performance buffer from
c_t_availabletotr_max.Set
tr_maxbuffer to +20%, as recommended by Ian Poll.
v0.51.0¶
Breaking changes¶
Geodesic interpolation is now used in
Flight.resample_and_fillwhen the great circle distance between waypoints (rather than the total segment length including vertical displacement) exceeds a threshold. This may change the interpolation method used when resampling flight segments with lengths close to the geodesic interpolation threshold.Fixed typo in
thermo.c_pmwill decrease computed values of moist heat capacity with non-zero specific humidity. We expect the downstream impact on contrail predictions byISSR,SAC,PCR, andCocipmodels to be minimal.np.nanis now used as the defaultfill_valueinMetDataArray.to_polygon_featureandMetDataArray.to_polygon_feature_collection. This ensures that NaN values are never included in polygon interiors unless a non-NaNfill_valueis explicitly passed as a keyword argument.
Features¶
Add
ERA5ModelLevelandHRESModelLevelinterfaces for accessing ERA5 and HRES data on model levels.Update ECMWF tutorial notebook with instructions for using model-level datalibs.
Add
HistogramMatchinghumidity scaling calibrated for model-level ERA5 data.Modify
polygon.find_multipolygon,MetDataArray.to_polygon_feature,MetDataArray.to_polygon_feature_collection, andMetDataArray.to_polyhedrato permit finding regions with values above or below a threshold.
Fixes¶
Use horizontal great circle distance to determine whether geodesic interpolation is used in
Flight.resample_and_fill. This ensures geodesic interpolation is used between sufficiently distant waypoints even when one or both waypoints contain NaN altitude data.Fix typo in moist heat capacity equation
thermo.c_pm.
Internals¶
Create static copy of dataframe for determining pressure at ECMWF model levels.
Extract model-level utilities in
ARCOERA5to their own module for reuse inERA5ModelLevelandHRESModelLevel.Update Makefile so
make ensure-era5-cacheduses default cache directory when run locally.Bump pinned black and ruff versions.
Disable mypy type checking on
functools.wrapsinsupport_arraylikedecorator to avoid error that appears starting on mypy 1.10.0.Update pinned
Cociptest output values after moist heat capacity bugfix.Add static files with ECMWF model levels and model-level ERA5 RHI quantiles to packaged data.
Pass
exc_type=ImportErrortopytest.importorskipin test fixtures that use pycontrails extensions to suppress pytest warning when extensions are not installed.Bump minimum pytest version 8.2 to ensure the
exc_typekwarg is available.
v0.50.2¶
Breaking changes¶
Replaces engine-uid
01P10IA024with04P10IA027(superseded in the IACO EDB).
Features¶
Adds support for the
E190aircraft type in the PS modelAdds
Flight.distance_to_coordswhich takes in a distance along a flight trajectory in meters and returns geodesic coordinates.Adds methods to
ps_operational_limitsto find the maximum and minimum mach numbers for a given set of operating conditions.Updates ICAO aircraft engine emissions databank (EDB) from v28c to v29b.
Internals¶
New data for gaseous and nvPM emissions for PW812D, PW812GA, RR Trent 7000 with improved nvPM combustor
Update nvPM emissions for IAE V2530-A5, PW1500G and PW1900G
Update PS model coeffiencts to match the latest version provided by Ian Poll
v0.50.1¶
Breaking changes¶
Updates to flight resampling logic now ensure that resampled waypoints include any and all times between flight start and end times that are a multiple of the resampling frequency. This may add an additional waypoint to some flights after resampling, and may result in
Flight.resample_and_fillreturning a flight with a single waypoint rather than an empty flight.
Features¶
Refine CoCiP contrail initialization model based on the work of Unterstrasser (2016, doi:10.5194/acp-16-2059-2016) and Karcher (2018, doi:10.1038/s41467-018-04068-0).
This update implements a refined parameterization of the survival fraction of contrail ice crystal number after the wake vortex phase (
f_surv). The parameterised model was developed by Unterstrasser (2016) based on outputs provided by large eddy simulations, and improves agreement with LES output relative to the default survival fraction parameterization in CoCiP.These changes replicate Fig. 4 of Karcher (2018), where
f_survnow depends on the initial number of ice crystals. These effects are particularly important, especially in the “soot-poor” scenario where the number fraction of contrail ice crystals that survives the wake vortex phase could be larger than the mass fraction, because the particles are larger in size.This also improves upon the existing assumption in CoCiP, where the survival fraction is estimated as the change in contrail ice water content (by mass) before and after the wake vortex phase. The Unterstrasser (2016) parameterization can be used in CoCiP by setting a new parameter,
unterstrasser_ice_survival_fraction, toTrue.
Adds optional ATR20 to CoCiPGrid model.
Fixes¶
Update flight resampling logic to align with expected behavior for very short flights, which is now detailed in the
Flight.resample_and_filldocstring.
Internals¶
Adds a parameter to
CoCipParams,unterstrasser_ice_survival_fraction, that activates the Unterstrasser (2016) survival parameterization when set toTrue. This is disabled by default, and only implemented forCoCiP.CoCiPGridwill produce an error if run withunterstrasser_ice_surival_fraction=True.Modifies
CoCiPGridso that settingcompute_atr_20(defined inCoCipParams) toTrueaddsglobal_yearly_mean_rfandatr20to CoCiP-grid output.Replaces
pycontrails.datalib.GOESash convention label “MIT” with “SEVIRI”Modifies meteorology time step selection logic in
CoCiPGridto reduce duplicate chunk downloads when reading from remote zarr stores.Updates unit tests for xarray v2024.03.0, which introduced changes to netCDF decoding that slightly alter decoded values. Note that some unit tests will fail for earlier xarray versions.
Updates
RegularGridInterpolatorto fall back on legacy scipy implementations of tensor-product spline methods when using scipy versions 1.13.0 and later.
v0.50.0¶
Features¶
Add
ARCOERA5interface for accessing ARCO ERA5 model level data. This interface requires the metview python package.Add ARCO ERA5 tutorial notebook highlighting the new interface.
Add support to output contrail warming impact in ATR20
Breaking changes¶
Reduce
CocipParams.met_level_bufferfrom(200, 200)to(40, 40). This change is motivated by the observation that the previous buffer was unnecessarily large and caused additional memory overhead. The new buffer is more in line with the typical vertical advection path of a contrail.
Fixes¶
Raise ValueError when
list[Flight]source is provided toCocipand thecopy_sourceparameter is set toFalse. Previously the source was copied in this case regardless of thecopy_sourceparameter.Fix broken link in the model level notebook.
Internals¶
The
datalib.parse_pressure_levelsnow sorts the pressure levels in ascending order and raises a ValueError if the input pressure levels are duplicated or have mixed signs.Add new
MetDataSource.is_single_levelproperty.Add
ecmwf.Divergence(a subclass ofMetVariable) for accessing ERA5 divergence data.Update the specific humidity interpolation notebook to use the new
ARCOERA5interface.Adds two parameters to
CoCipParams,compute_atr20andglobal_rf_to_atr20_factor. Setting the former toTruewill add bothglobal_yearly_mean_rfandatr20to the CoCiP output.Bump minimum pytest version to 8.1 to avoid failures in release workflow.
v0.49.5¶
Fixes¶
Fix bug in which
Cocip._process_raddropped radiation dataset attributes introduced in v0.49.4.
v0.49.4¶
Breaking changes¶
Remove the
CocipGridParams.met_slice_dtparameter. Now met downselection is handled automatically during contrail evolution. When themetandraddata passed intoCocipGridare not already loaded into memory, this update may makeCocipGridslightly more performant.No longer explicitly load
metandradtime slices into memory inCocipGrid. This now only occurs downstream when interpolation is performed. This change better alignsCocipGridwith other pycontrails models.Remove the
cocipgrid.cocip_time_handlingmodule. Any useful tooling has been moved directly to thecocipgrid.cocip_gridmodule.Remove the
CocipGrid.timedictattribute. Add aCocipGrid.timestepsattribute. This is now applied in the same manner that theCocipmodel uses itstimestepsattribute.Simplify the runtime estimate used in constructing the
CocipGridtqdmprogress bar. The new estimate is less precise than the previous estimate and should not be trusted for long-running simulations.Deprecate
MetBase.variablesin favor ofMetBase.indexes.
Features¶
Add support for 9 additional aircraft types in the Poll-Schumann (PS) aircraft performance model. The new aircraft types are:
A338
A339
A35K
B37M
B38M
B39M
B78X
BCS1
BCS3
Modify PS coefficients for B788, B789, and A359.
Support running
CocipGridon meteorology data without a uniformly-spaced time dimension. TheCocipGridimplementation now no longer assumesmet["time"].diff()is constant.Add a
MetDataset.downselect_metmethod. This performs a met downselection in analogy withGeoVectorDataset.downselect_met.
Fixes¶
Improve clarity of warnings produced when meteorology data doesn’t cover the time range required by a gridded CoCiP model.
No longer emit
pandaswarning whenFlight.resample_and_fill(..., drop=True, ...)is called with non-float data.Correctly handle
CocipGridraddata with non-uniform time steps.
v0.49.3¶
Features¶
Re-organize notebooks in documentation.
Add new model level tutorial notebook.
Add new high-level
Flight.clean_and_resamplemethod. This method parallels theFlight.resample_and_fillmethod but performs additional altitude filtering. In essence, this method is a combination ofFlight.filter_altitudeandFlight.resample_and_fill.
Breaking changes¶
Remove
Flight.fit_altitudemethod in favor ofFlight.filter_altitude. The new method now only applies a median filter during cruise flight phase.
Fixes¶
Remove opaque warning issued when all tau_contrail values are nan in
Cocipevolution.Emit warning in
Cocip.evalif the advected contrail is blown outside of the domain of the met data.Remove empty flights in
Fleet.from_seq. Issue warning if an empty flight is encountered.Emit warning when
Flight.resample_and_fillreturns an empty flight.
Internals¶
Modify test workflow to use Makefile recipes and ensure early failures are detected in CI.
Pin
blackandruffversions for consistency between local and CI/CD environments.Improve development documentation.
Improve handling of missing credentials in tests (
make nb-test,make doctest).Update time frequency aliases for
pandas2.2 compatibility.Update cython annotations for
scipy1.12 compatibility.Improve notebook output testing capabilities (
make nb-test).Add new convenience Make recipe to execute all notebooks in the docs (
make nb-execute).Add new Make recipe to cleanup notebooks (
make nb-clean).Add pre-commit hook to check if notebooks are clean.
Re-organize notebooks in documentation.
Clean up contributing and develop documentation.
Automatically parse
np.timedelta64-like model params inModel.update_params.
v0.49.2¶
Features¶
Support pandas Copy-on-Write. This can be enabled with
pd.set_option("mode.copy_on_write", True)or by setting thePANDAS_COPY_ON_WRITEenvironment variable.
Fixes¶
Ensure the
Flight.fuelattribute is preserved for theFlight.filtermethod.Ensure the
Fleet.fl_attrsattribute is preserved for theFleet.filtermethod.Raise
ValueErrorwhenFlight.sortorFleet.sortis called. Both of these subclasses assume a custom sorting order that is enforced in their constructors.Always correct intermediate thrust coefficients computed in the
PSGridmodel. This correction is already enabled by default in thePSFlightmodel.Include
attrfields in the ValueError message raised inCocipGridwhen not all aircraft performance variables are present on thesourceparameter.Allow
mach_numberas a replacement fortrue_airspeedinCocipGridaircraft performance determination.
Internals¶
Make
Fueland its subclassesJetA,SAFBlend, andHydrogenFuelfrozen.No longer copy
metwhenModels.downselect_metis called. In some modes of operation, this reduces the memory footprint of the model.Update codebase for more harmony with PDEP 8 and Copy-on-Write semantics.
Add
defaultparameter to theVectorDataset.get_data_or_attrmethod.
v0.49.1¶
Fixes¶
Fix memory bottleneck in
CocipGridsimulation by avoiding expensive call topd.concat.Require
oldest-supported-numpyfor python 3.12. Remove logic fornumpy1.26.0rc1 in thepyproject.tomlbuild system.
v0.49.0¶
This release updates the Poll-Schumann (PS) aircraft performance model to version 2.0. It also includes a number of bug fixes and internal improvements.
Features¶
Add convenience
Fleet.resample_and_fill.Update the PS model aircraft-engine parameters.
Improve PS model accuracy in fuel consumption estimates.
Improve PS model accuracy in overall propulsive efficiency estimates.
Include additional guardrails in the PS model to constrain the operational limits of different aircraft-engine types, i.e., the maximum permitted Mach number by altitude, maximum available thrust coefficient, maximum lift coefficient, and maximum allowable aircraft mass.
Fixes¶
Update polygon algorithm to use
shapely.Polygoninstead ofshapely.LinearRingfor contours with at least 4 vertices.Fix
Fleet.to_flight_listto avoid duplicating global attributes on the childFlightinstances.Add
__slots__toGeoVectorDataset,Flight, andFleet. The baseVectorDatasetclass already uses__slots__.Add
Fleet.copymethod.Improve
Fleet.__init__implementation.Ensure
sourceparameter is mutated inCocipGrid.evalwhen the model parametercopy_source=False.
v0.48.1¶
Features¶
Generalize
met.shift_longitude()to translate longitude coordinates onto any domain bounds.Add
VectorDataset.to_dict()methods to output Vector data as dictionary. This method enablesFlight.to_dict()objects to be serialized for input to the Contrails API.Add
VectorDataset.from_dict()class method to createVectorDatasetclass from dictionary.Support more time formats, including timezone aware times, in
VectorDatasetcreation. All timezone aware `”time”`` coordinates are converted to UTC and stripped of timezone identifier.
Fixes¶
Fix issue in the
wake_vortex.max_downward_displacementfunction in which float32 dtypes were promoted to float64 dtypes in certain cases.Ignore empty vectors in
VectorDataset.sum.
Internals¶
Set
frozen=Trueon theMetVariabledataclass.Test against python 3.12 in the GitHub Actions CI. Use python 3.12 the docs and doctest workflows.
v0.48.0¶
This release includes a number of breaking changes and new features. If upgrading from a previous version of pycontrails, please read the changelog carefully. Open an issue if you experience problems.
Breaking changes¶
When running
Cocipand otherpycontrailsmodels, themetandradparameter must now contain predefined metadata attributesprovider,dataset, andproductdescribing the met source. An error will now be raised inCocipif these attributes are not present.Deprecate passing arbitrary
kwargsinto theMetDataArrayconstructor.No longer convert accumulated radiation data to average instantaneous data in
ERA5andHRESinterfaces. This logic is now handled downstream by the model (e.g.,Cocip). This change allows for more flexibility in theraddata passed into the model and avoids unnecessary computation in theMetDataSourceinterfaces.Add new
MetDataSource.set_met_source_metadataabstract method. This should be called within the implementing classopen_metdatasetmethod.No longer take a finite difference in the time dimension for HRES radiation data. This is now also handled natively in
Cocip.No longer convert relative humidity from a percentage to a fraction in
ERA5andHRESinterfaces.Require the
HRESstreamparameter to be one of["oper", "enfo"]. Require thefield_typeparameter to be one of["fc", "pf", "cf", "an"].Remove the
stepsandstep_offsetproperties in theGFSForecastinterface. Now thetimestepsattribute is the only source of truth for determining AWS S3 keys. Change thefilenamemethod to take in adatatimetimestep instead of anintstep. No longer assign the first step radiation data to the zeroth step.Change the return type of
ISSR.eval,SAC.eval, andPCR.evalfromMetDataArraytoMetDataset. This is more consistent with the return type of otherpycontrailsmodels and more closely mirrors the behavior of vector models. Set outputattrsmetadata on the globalMetDatasetinstead of the individualMetDataArrayin each case.
Features¶
Rewrite parts of the
pycontrails.core.datalibmodule for higher performance and readability.Add optional
attrsandattrs_kwargsparameters toMetDatasetconstructor. This allows the user to customize the attributes on the underlyingxarray.Datasetobject. This update makesMetDatasetmore consistent withVectorDataset.Add three new properties
provider_attr,dataset_attr, andproduct_attrtoMetDataset. These properties give metadata describing the underlying meterological data source.Add new
Model.transfer_met_source_attrsmethod for more consistent handling of met source metadata on thesourceparameter passed intoModel.eval.No longer require
geopotentialdata when computingtau_cirrus. If neithergeopotentialnorgeopotential_heightare available, geopotential is approximated from the geometric height. No longer require geopotential on themetparameter inCociporCocipGrid.Remove the
Cocipshift_radiation_timeparameter. This is now inferred directly from theradmetadata. An error is raised if the necessary metadata is not present.Allow
Cocipto run with both instantaneous (W m-2) and accumulated (J m-2) radiation data.Allow
Cocipto run with accumulated ECMWF HRES radiation data.
Fixes¶
Correct radiation unit in the
ACCFwrapper model [#64]. Both instantaneous (W m-2) and accumulated (J m-2) radiation data are now supported, and theACCFwrapper will handle each appropriately.Avoid unnecessary writing and reading of temporary files in
ERA5.cache_datasetandHRES.cache_dataset.Fix timestep resolution bug in
GFSForecast. When thegridparameter is 0.5 or 1.0, forecasts are only available every 3 hours. Previously, thetimestepsproperty would define an hourly timestep.
Internals¶
Include
nameparameter inMetDataArrayconstructor.Make the
coordinates.slice_domainfunction slightly more performant by explicitly dropping nan values from therequestparameter.Round unwieldy floating point numbers in
GeoVectorDataset._display_attrs.Remove the
ecmwflibspackage from theecmwfoptional dependencies.Add NPY to
ruffrules.Add convenience
MetDataset.standardize_variablesmethod.Remove the
p_settingsattribute on theACCFinterface. This is now constructed internally withinACCF.eval. Replace theACCF._update_accf_configmethod with a_get_accf_configfunction.
v0.47.3¶
Fixes¶
Strengthen
correct_fuel_flowin thePSmodelto account for descent conditions.Clip the denominator computed in
pycontrails.physics.jet.equivalent_fuel_flow_rate_at_cruise.Ensure the token used within GitHub workflows has the fewest privileges required. Set top-level permissions to
nonein each workflow file. Remove unnecessary permissions previously used in thegoogle-github-actions/authaction.Fix bug in
radiative_forcing.effective_tau_contrailidentified in #99.Fix the unit for
vertical_velocityingeo.advect_level.Fix bug appearing in
Flight._geodesic_interpolationin which a single initial large gap was not interpolated with a geodesic path.
Internals¶
Add
FlightPhaseto thepycontrailsnamespace.
v0.47.2¶
Features¶
New experimental
GOESinterface for downloading and visualizing GOES-16 satellite imagery.Add new GOES example notebook highlighting the interface.
Build python 3.12 wheels for Linux, macOS, and Windows on release. This is in addition to the existing python 3.9, 3.10, and 3.11 wheels.
Fixes¶
Use the experimental version number parameter
Einpycontrails.ecmwf.hres.get_forecast_filename. Update the logic involved in setting the dissemination data stream indicatorS.Change the behavior of
_altitude_interpolationmethod that is called withinresample_and_fill. Step climbs are now placed in the middle of long flight segments. Descents continue to occur at the end of segments.
Internals¶
Provide consistent
ModuleNotFoundErrormessages when optional dependencies are not installed.Move the
synthetic_flightmodule into thepycontrails.extnamespace.
v0.47.1¶
Fixes¶
Fix bug in
PSGridin which themetdata was assumed to be already loaded into memory. This caused errors when runningPSGridwith aMetDatasetsource.Fix bug (#86) in which
Cocip.evalloses thesourcefuel type. Instead of instantiating a newFlightorFleetinstance with the default fuel type, theCocip._bundle_resultsmethod now overwrites theself.source.dataattribute with the bundled predictions.Avoid a memory explosion when running
Cocipon a large non-dask-backedmetparameter. Previously thetau_cirruscomputation would be performed in memory over the entiremetdataset.Replace
datetime.utcfromtimestamp(deprecated in python 3.12) withdatetime.fromtimestamp.Explicitly support python 3.12 in the
pyproject.tomlbuild system.
Internals¶
Add
compute_tau_cirrus_in_model_initparameter toCocipParams. This controls whether to compute the cirrus optical depth inCocip.__init__orCocip.eval. When set to"auto"(the default), thetau_cirrusis computed inCocip.__init__if and only if themetparameter is dask-backed.Change data requirements for the
EmpiricalGridaircraft performance model.Consolidate
ERA5.cache_datasetandHRES.cache_datasetonto commonECMWFAPI.cache_datasetmethod. Previously the child implementations were identical.No longer require the
pyprojpackage as a dependency. This is now an optional dependency, and can be installed withpip install pycontrails[pyproj].
v0.47.0¶
Implement a Poll-Schumann (PSGrid) theoretical aircraft performance over a grid.
Breaking changes¶
Move the
pycontrails.models.aircraft_performancemodule topycontrails.core.aircraft_performance.Rename
PSModel->PSFlight.
Fixes¶
Use the instance
fuelattribute in theFleet.to_flight_listmethod. Previously, the defaultJetAfuel was always used.Ensure the
Fleet.fuelattribute is inferred from the underlying sequence of flights in theFleet.from_seqmethod.
Features¶
Implement the
PSGridmodel. For a given aircraft type and position, this model computes optimal aircraft performance at cruise conditions. In particular, this model can be used to estimate fuel flow, engine efficiency, and aircraft mass at cruise. In particular, thePSGridmodel can now be used in conjunction withCocipGridto simulate contrail formation over a grid.Refactor the
Emissionsmodel so thatEmissions.evalruns withsource: GeoVectorDataset. Previously, theevalmethod required aFlightinstance for thesourceparameter. This change allows theEmissionsmodel to run more seamlessly as a sub-model of a gridded model (ie,CocipGrid),No longer require
pycontrails-badato import or run theCocipGridmodel. Instead, theCocipGridParams.aircraft_performanceparameter can be set to anyAircraftPerformanceGridinstance. This allows theCocipGridmodel to run with any aircraft performance model that implements theAircraftPerformanceGridinterface.Add experimental
EmpiricalAircraftPerformanceGridmodel.Add convenience
GeoVectorDataset.T_isamethod to compute the ISA temperature at each point.
Internals¶
Add optional
climb_descend_at_endparameter to theFlight.resample_and_fillmethod. If True, the climb or descent will be placed at the end of each segment rather than the start.Define
AircraftPerformanceGridParams,AircraftPerformanceGrid, andAircraftPerformanceGridDataabstract interfaces for gridded aircraft performance models.Add
set_attrparameter toModels.get_source_param.Better handle
source,source.attrs, andparamscustomizations inCocipGrid.Include additional classes and functions in the
pycontrails.models.emissionsmodule.Hardcode the paths to the static data files used in the
EmissionsandPSFlightmodels. Previously these were configurable by model parameters.Add
altitude_ftparameter to theGeoVectorDatasetconstructor. Warn if at least two ofaltitude_ft,altitude, andlevelare provided.Allow instantiation of
Modelinstances withparams: ModelParams. Previously, theparamsparameter was required to be adict. The current implementation checks that theparamsparameter is either adictor has typedefault_paramson theModelclass.
v0.46.0¶
Support “dry advection” simulation.
Features¶
Add new
DryAdvectionmodel to simulate sediment-free advection of an aircraft’s exhaust plume. This model is experimental and may change in future releases. By default, the current implementation simulates plume geometry as a cylinder with an elliptical cross section (the same geometry assumed in CoCiP). Wind shear perturbs the ellipse azimuth, width, and depth over the plume evolution. TheDryAdvectionmodel may also be used to simulate advection without wind-shear effects by setting the model parametersazimuth,width, anddepthto None.Add new Dry Advection example notebook highlighting the new
DryAdvectionmodel and comparing it to theCocipmodel.Add optional
fill_valueparameter toVectorDataset.sum.
Fixes¶
(#80) Fix unit error in
wake_vortex.turbulent_kinetic_energy_dissipation_rate. This fix affects the estimate of wake vortex max downward displacement and slightly changesCocippredictions.Change the implementation of
Flight.resample_and_fillso that lat-lon interpolation is linear in time. Previously, the timestamp associated to a waypoint was floored according to the resampling frequency without updating the position accordingly. This caused errors in segment calculations (e.g., true airspeed).
Internals¶
Add optional
keep_original_indexparameter to theFlight.resample_and_fillmethod. IfTrue, the time original index is preserved in the output in addition to the new time index obtained by resampling.Improve docstrings in
wake_vortexmoduleRename
wake_vortexfunctions to removeget_prefix at the start of each function name.Add pytest command line parameter
--regenerate-resultsto regenerate static test fixture results. Automate in make recipemake pytest-regenerate-results.Update handling of
GeoVectorDataset.required_keystheGeoVectorDatasetconstructor. Add class variableGeoVectorDataset.vertical_keysfor handing the vertical dimension.Rename
CocipParam.max_contrail_depth->CocipParam.max_depth.Add
units.dt_to_secondsfunction to convertnp.timedelta64tofloatseconds.Rename
thermo.p_dz->thermo.pressure_dz.
v0.45.0¶
Add experimental support for simulating radiative effects due to contrail-contrail overlap.
Features¶
Support simulating contrail contrail overlap when running the
Cocipmodel with aFleetsource. Thecontrail_contrail_overlappinganddz_overlap_mparameters govern the overlap calculation. This mode of calculation is still experimental and may change in future releases.Rewrite the
pycontrails.models.cocip.outputmodules into a singlepycontrails.cocip.output_formatsmodule. The new module supports flight waypoint summary statistics, contrail waypoints summary statistics, gridded outputs, and time-slice outputs.Add new
GeoVectorDataset.to_lon_lat_gridmethod. This method can be thought of as a partial inverse to theMetDataset.to_vectormethod. The current implementation is brittle and may be revised in a future release.
Fixes¶
Extend
Models.set_source_metto allowinterpolation_q_method="cubic-spline"when working withMetDatasetsource (ie, so-called gridded models). Previously aNotImplementedErrorwas raised.Ensure the
Flight.copyimplementation works withFleetinstances as well.Avoid looping over
keystwice inVectorDataset.broadcast_attrs. This is a slight performance enhancement.Fix
Fleetsignature for compatibility withFlight.Fix a few hard-coded assumptions in broadcasting aircraft performance and emissions when running
Cocipwith aFleetsource. The previous implementation did not consider the possibility of aircraft performance variables onFlight.dataandFlight.attrsseparately.
Internals¶
Add optional
raise_errorparameter to theVectorDataset.broadcast_attrsmethod.Update
Fleetinternals.
v0.44.2¶
Fixes¶
Narrow type hints on the ABC
AircraftPerformancemodel. TheAircraftPerformance.evalmethod requires aFlightobject for thesourceparameter.In
PSFlight.eval, explicitly set any aircraft performance data at waypoints with zero true airspeed tonp.nan. This avoids numpyRuntimeWarnings without affecting the results.Fix corner-case in the
polygon.buffer_and_cleanfunction in which the polygon created by buffering theopencvcontour is not valid. Now a second attempt to buffer the polygon is made with a smaller buffer distance.Ignore RuntimeError raised in
scipy.optimize.newtonif the maximum number of iterations is reached before convergence. This is a workaround for occasional false positive convergence warnings. The pycontrails use-case may be related to this GitHub issue.Update the
Models.__init__warnings whenhumidity_scalingis not provided. The previous warning provided an outdated code example.Ensure the
interpolation_q_methodused in a parent model is passed into thehumidity_scalingchild model in theModels.__init__method. If the twointerpolation_q_methodvalues are different, a warning is issued. This could be extended to other model parameters in the future.
Features¶
Enable
ExponentialBoostLatitudeCorrectionHumidityScalinghumidity scaling for the model parameterinterpolation_q_method="cubic_spline".Add GFS notebook example.
Breaking changes¶
Remove
ExponentialBoostLatitudeCorrectionHumidityScalingParams. These parameters are now hard-coded in theExponentialBoostLatitudeCorrectionHumidityScalingmodel.
v0.44.1¶
Breaking changes¶
By default, call
xr.open_mfdatasetwithlock=Falsein theMetDataSource.open_datasetmethod. This helps alleviate adaskthreading issue similar to this GitHub issue.
Fixes¶
Support
MetDatasetsource in theHistogramMatchinghumidity scaling model. Previously onlyGeoVectorDatasetsources were explicitly supported.Replace
np.gradientwithdask.array.gradientin thetau_cirrusmodule. This ensures that the computation is done lazily for dask-backed arrays.Round to 6 digits in the
polygon.determine_bufferfunction. This avoid unnecessary warnings for rounding errors.Fix type hint for
opencv-python4.8.0.74.
Internals¶
Take more care with
floatandinttypes in thecontrail_propertiesmodule. Prefernp.cliptonp.whereornp.maximumfor clipping values.Support
air_temperatureinCocipGridverbose formation outputs.Remove
pytest-timeoutdev dependency.
v0.44.0¶
Support for the Poll-Schumann aircraft performance model.
Features¶
Implement a basic working version of the Poll-Schumann (PS) aircraft performance model. This is experimental and may undergo revision in future releases. The PS Model currently supports the following 53 aircraft types:
A30B
A306
A310
A313
A318
A319
A320
A321
A332
A333
A342
A343
A345
A346
A359
A388
B712
B732
B733
B734
B735
B736
B737
B738
B739
B742
B743
B744
B748
B752
B753
B762
B763
B764
B77L
B772
B77W
B773
B788
B789
E135
E145
E170
E195
MD82
MD83
GLF5
CRJ9
DC93
RJ1H
B722
A20N
A21N
The “gridded” version of this model is not yet implemented. This will be added in a future release.
Improve the runtime of instantiating the
Emissionsmodel by a factor of 10-15x. This translates to a time savings of several hundred milliseconds on modern hardware. This improvement is achieved by more efficient parsing of the underlying static data and by deferring the construction of the interpolation artifacts until they are needed.Automatically use a default engine type from the aircraft type in the
Emissionsmodel if anengine_uidparameter is not included on thesource. This itself is configurable via theuse_default_engine_uidparameter on theEmissionsmodel. The default mappings from aircraft types to engines is included inpycontrails/models/emissions/static/default-engine-uids.csv.
Breaking changes¶
Remove the
Aircraftdataclass fromFlightinstantiation. Any code previously using this should instead directly pass additionalattrsto theFlightconstructor.The
load_factoris now required inAircraftPerformancemodels. The globalDEFAULT_LOAD_FACTORconstant inpycontrails.models.aircraft_performanceprovides a reasonable default. This is currently set to 0.7.Use a
takeoff_massparameter inAircraftPerformancemodels if provided in thesource.attrsdata.No longer use a reference mass
ref_massinAircraftPerformancemodels. This is replaced by thetakeoff_massparameter if provided, or calculated from operating empty operating mass, max payload mass, total fuel consumption mass, reserve fuel mass, and the load factor.
Fixes¶
Remove the
fuelparameter from theEmissionsmodel. This is inferred directly from thesourceparameter inEmissions.eval.Fix edge cases in the
jet.reserve_fuel_requirementsimplementation. The previous version would returnnanfor some combinations offuel_flowandsegment_phasevariables.Fix a spelling mistake:
units.kelvin_to_celcius->units.kelvin_to_celsius.
Internals¶
Use
ruffin place ofpydocstylefor linting docstrings.Use
ruffin place ofisortfor sorting imports.Update the
AircraftPerformancetemplate based on the patterns used in the newPSFlightclass. This may change again in the future.
v0.43.0¶
Support experimental interpolation against gridded specific humidity. Add new data-driven humidity scaling models.
Features¶
Add new experimental
interpolation_q_methodfield to theModelParamsdata class. This parameter controls the interpolation methodology when interpolation against gridded specific humidity. The possible values are:None: Interpolate linearly against specific humidity. This is the default behavior and is the same as the previous behavior."cubic-spline": Apply cubic-spline scaling to the interpolation table vertical coordinate before interpolating linearly against specific humidity."log-q-log-p": Interpolate in the log-log domain against specific humidity and pressure.
This interpolation parameter is used when calling
pycontrails.core.models.interpolate_met. It can also be used directly with the new lower-levelpycontrails.core.models.interpolate_gridded_specific_humidityfunction.Add new experimental
HistogramMatchinghumidity scaling model to match RHi values against IAGOS observations. The previousHistogramMatchingWithEckelscaling is still available when working with ERA5 ensemble members.Add new tutorial discussing the new specific humidity interpolation methodology.
Breaking changes¶
Add an optional
q_methodparameter to thepycontrails.core.models.interpolate_metfunction. The default valueNoneagrees with the previous behavior.Change function signatures in the
cocip.pymodule for consistency. Theinterp_kwargsparameter is now unpacked in thecalc_timestep_meterologysignature. Renamekwargstointerp_kwargswhere appropriate.Remove the
cache_sizeparameter inMetDataset.from_zarr. Previously this parameter allowed the user to wrap the Zarr store in aLRUCacheStoreto improve performance. Changes to Zarr internals have broken this approach. Custom Zarr patterns should now be handled outside ofpycontrails.
Fixes¶
Recompute and extend quantiles for histogram matching humidity scaling. Quantiles are now available for each combination of
q_methodand the following ERA5 data products: reanalysis and ensemble members 0-9. This data is available as a parquet file and is packaged withpycontrails.Fix the precomputed Eckel coefficients. Previous values where computed for different interpolation assumptions and were not correct for the default interpolation method.
Clip the scaled humidity values computed by the
humidity_scaling.eckel_scalingfunction to ensure that they are non-negative. Previously, both relative and specific humidity values arising from Eckel scaling could be negative.Handle edge case of all NaN values in the
T_critical_sacfunction in thesac.pymodule.Avoid extraneous copy when calling
VectorDataset.sum.Officially support
numpyv1.25.0.Set a
pytest-timeoutlimit for tests intests/unit/test_ecmwf.pyto avoid hanging tests.Add
forecast_stepparameter to theACCFmodel.
Internals¶
Refactor auxillary functions used by
HistogramMatchingWithEckelto better isolated histogram matching from Eckel scaling.Refactor
intersect_metmethod inpycontrails.core.modelsto handle experimentalq_methodparameter.Include a
q_methodfield inModel.interp_kwargs.Include precomputed humidity lapse rate values in the new
pycontrails.core.models._load_splinefunction.Move the
humidity_scaling.pymodule into its own subdirectory withinpycontrails/models.
v0.42.2¶
Re-release of v0.42.1.
v0.42.1¶
Features¶
Add new
HistogramMatchingWithEckelexperimental humidity scaling model. This is still a work in progress.Add new
Flight.fit_altitudemethod which uses piecewise linear fitting to smooth a flight profile.Add new
pycontrails.core.flightplanmodule 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
sourceparameter inCocip.evalwhen the flight doesn’t generate any persistent contrails.Remove params
humidity_scaling,rhi_adj_uncertainty, andrhi_boost_exponent_uncertaintyfromCocipUncertaintyParams.Change the default value for
parallelfrom True to False inxr.open_mfdataset. This can be overridden by setting thexr_kwargsparameter 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.pythat suffers from the same issue.Fix issue encountered in
Cocip.evalwhen 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_gapproperty. The previous property on theFlightclass was not applicable toFleetinstances.Fix warning in
Flightclass to correctly suggest adding kwargdrop_duplicated_times.Fix an issue in the
VectorDatasetconstructor with adataparameter 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_vortexmodules.Slight performance enhancements in the
radiative_forcingmodule.Change the default value of
u_windandv_windfrom None to 0 inFlight.segment_true_airspeed. This makes more sense semantically.
v0.42.0¶
Phase 1 of the Spire datalib, which contains functions to identify unique flight trajectories from the raw Spire ADS-B data.
Features¶
Add a
pycontrails.core.airportmodule to read and process the global airport database, which can be used to identify the nearest airport to a given coordinate.Add a
pycontrails.datalib.spire.cleanfunction to remove and address erroneous waypoints in the raw Spire ADS-B data.Add a
pycontrails.datalib.spire.filter_altitudefunction to remove noise in cruise altitude.Add a
pycontrails.datalib.spire.identify_flightsfunction to identify unique flight trajectories from ADS-B messages.Add a
pycontrails.datalib.spire.validate_trajectoryfunction to check the validity of the identified trajectories from ADS-B messages.Add a
FlightPhaseintegerEnumin theflightmodule. This includes a newlevel_flightflight phase.
Internals¶
Add unit tests providing examples to identify unique flights.
Rename
flight._dt_waypoints->flight.segment_duration.Move
jet.rate_of_climb_descent->flight.segment_rocd.Move
jet.identify_phase_of_flight->flight.segment_phase.Update
FlightPhaseto be a dictionary enumeration of flight phases.Add references to
trafficlibrary.
v0.41.0¶
Improve polygon algorithms.
Features¶
Rewrite the
polygonmodule to run computation with opencv in place of scikit-image for finding contours. This change improves the algorithm runtime and fixes some previous unstable behavior in finding nested contours. For an introduction to the methodology, see the OpenCV contour tutorial.
Breaking changes¶
Completely rewrite the
polygonmodule. Replace the “main” public functionpolygon.find_contours_to_depthwithpolygon.find_multipolygon. Replace thepolygon.contour_to_lat_lonfunction withpolygon.multipolygon_to_geojson. Returnshapelyobjects when convenient to do so.Convert continuous data to binary for polygon computation.
Remove parameters
min_area_to_iterateanddepthin theMetDataArray.to_polygon_featuremethod. Thedepthparameter has been replaced by the booleaninteriorsparameter. Add apropertiesparameter for adding properties to thePolygonandMultiPolygonfeatures. Themax_areaandepsilonparameters are now expressed in terms of latitude-longitude degrees.
Internals¶
Add
opencv-python-headless>=4.5as an optional “vis” dependency. Some flavor ofopencvis required for the updated polygon algorithms.
v0.40.1¶
Fixes¶
Use oldest-supported-numpy for building pycontrails wheels. This allows pycontrails to be compatible with environments that use old versions of numpy. The pycontrails v0.40.0 wheels are not compatible with numpy 1.22.
v0.40.0¶
Support scipy 1.10, improve interpolation performance, and fix many windows issues.
Features¶
Improve interpolation performance by cythonizing linear interpolation. This extends the approach taken in scipy 1.10. The pycontrails cython routines allow for both float64 and float32 grids via cython fused types (the current scipy implementation assumes float64). In addition, interpolation up to dimension 4 is supported (the scipy implementation supports dimension 1 and 2).
Officially support scipy 1.10.
Officially test on windows in the GitHub Actions CI.
Build custom wheels for python 3.9, 3.10, and 3.11 for the following platforms:
Linux (x86_64)
macOS (arm64 and x86_64)
Windows (x86_64)
Breaking changes¶
Change
MetDatasetandMetDataArrayconventions: underlying dimension coordinates are automatically promoted to float64.Change how datetime arrays are converted to floating values for interpolation. The new approach introduces small differences compared with the previous implementation. These differences are significant enough to see relative differences in CoCiP predictions on the order of 1e-4.
Fixes¶
Unit tests no longer raise errors when the
pycontrails-badapackage is not installed. Instead, some tests are skipped.Fix many numpy casting issues encountered on windows.
Fix temp file issues encountered on windows.
Officially support changes in
xarray2023.04 andpandas2.0.
Internals¶
Make the
interpolationmodule more aligned with scipy 1.10 enhancements to theRegularGridInterpolator. In particular, grid coordinates now must be float64.Use cibuildwheel to build wheels for Linux, macOS (arm64 and x86_64), and Windows on release in Github Actions. Allow this workflow to be triggered manually to test the release process without actually publishing to PyPI.
Simplify interpolation with pre-computed indices (invoked with the model parameter
interpolation_use_indices) via aRGIArtifactsinterface.Overhaul much of the interpolation module to improve performance.
Slight performance enhancements to the
metmodule.
v0.39.6¶
Features¶
Add
geo.azimuthandgeo.segment_azimuthfunctions to calculate the azimuth between coordinates. Azimuth is the angle between coordinates relative to true north on the interval[0, 360).
Fixes¶
Fix edge case in polygon algorithm by utilizing the
fully_connectedparameter inmeasure.find_contours. This update leads to slight changes in interior contours in some cases.Fix hard-coded POSIX path in
conftest.pyfor windows compatibility.Address
PermissionErrorraised byshutil.copywhen the destination file is open in another thread. The copy is skipped and a warning is logged.Fix some unit tests in
test_vector.pyandtest_ecmwf.pyfor windows compatibility. There are still a few tests that fail on windows (unrelated to changes in this release) that will be fixed in v0.40.0.Allow
cachestore=Noneto skip caching inERA5,HRES, andGFSinterfaces. Previously a defaultDiskCacheStorewas created even whencachestore=None. By default, caching is still enabled.
Internals¶
Clean up
geomodule docstrings.Add Wikipedia reference for Azimuth.
Convert
MetBase._loadto from a class method to a function.
v0.39.5¶
Fixes¶
Fix
docs/examples/CoCiP.ipynbexample demonstrating aircraft performance integrationFix unit test caused by breaking change in pyproj 3.5.0
Internals¶
Add additional Zenodo metadata
Execute notebook examples in Docs Action
v0.39.4¶
Internals¶
Add additional Zenodo metadata
Add Doc / Notebook test Action to run notebook test (
make nb-test) and doctests (make doctest) on pull requests.Update Docs Action to use python 3.11.
v0.39.3¶
Fixes¶
Update links in the README.
Update the release guide to include a checklist of steps to follow when cutting a release.
v0.39.2¶
Fixes¶
Fix links in documentation website.
Deploy build to PyPI (in addition to Test PyPI) on release.
v0.39.1¶
Features¶
Use setuptools_scm to manage the
pycontrailsversion.
v0.39.0¶
Features¶
Add Apache-2 LICENSE and NOTICE files (#21)
Add CONTRIBUTING document
Update documentation website py.contrails.org. Includes
installanddevelopguides, update citations and many other small improvements (#19).Initiate the Github Discussion forum (#22).
Fixes¶
Fix erroneous docstrings in
emissions.py(#25)
Internals¶
Add Github action to push to
pypion tag (#3)Replace
flake8withrufflinterAdd
nb-cleanto pre-commit hooks for example notebooksAdd
doc8rst linter and pre-commit hook
v0.38.0¶
Breaking changes¶
Change default value of
epsilonparameter in methodMetDataArray.to_polygon_featurefrom 0.15 to 0.0.Change the polygon simplification algorithm. The new implementation uses
shapely.bufferand doesn’t try to preserve the topology of the simplified polygon. This change may result in slightly different polygon geometries.
Internals¶
Add
depthparameter toMetDataArray.to_polygon_featureto control the depth of the contour searching.Add experimental
convex_hullparameter toMetDataArray.to_polygon_featureto control whether to take the convex hull of each contour.Warn if
iso_valueis not specified inMetDataArray.to_polygon_feature.
Fixes¶
Consolidate three redundant implementations of standardizing variables into a single
met.standardize_variables.Ensure simplified polygons returned by
MetDataArray.to_polygon_featureare disjoint. While non-disjoint polygons don’t violate the GeoJSON spec, they can cause problems in some applications.
v0.37.3¶
Internals¶
Add citations for ISA calculations
Abstract functionality to convert a Dataset or DataArray to longitude coordinates
[-180, 180)intocore.met.shift_longitude. Add tests for method.Add auto-formatting checks to CI testing
v0.37.2¶
ACCF integration updates
Fixes¶
Fixes ability to evaluate ACCF model over a
MetDatasetgrid by passing in tuple of (dims, data) when assigning dataFixes minor issues with ACCF configuration and allows more configuration options
Updates example ACCF notebook with example of how to set configuration options when evaluating ACCFs over a grid
v0.37.1¶
Features¶
Include “rhi” and “iwc” variables in
CocipGridverbose outputs.
v0.37.0¶
Breaking changes¶
Update CoCiP unit test static results for breaking changes in tau cirrus calculation. The relative difference in pinned energy forcing values is less than 0.001%.
Fixes¶
Fix geopotential height gradient calculation in the
tau_cirrusmodule. When calculating finite differences along the vertical axis, the tau cirrus model previously divided the top and bottom differences by 2. To numerically approximate the derivative at the top and bottom levels, these differences should have actually been divided by 1. The calculation now usesnp.gradientto calculate the derivative along the vertical axis, which handles this correctly.Make tau cirrus calculation slightly more performant.
Include a warning in the suspect
IFS._calc_geopotentialimplementation.
Internals¶
Remove
_deprecated.tau_cirrus_alt. This function is now the defaulttau_cirruscalculation. The originaltau_cirruscalculation is still available in the_deprecatedmodule.Run
flake8over test modules.