What’s new#
Unreleased#
New features#
The nodal corrections of
xoa.tideanalyses and predictions follow the time, updated everynodal_step(one day by default).Compound constituents accept negative multipliers.
Add 13 constituents to the default database, like MSf, MU2, NU2, L2 and 2SM2.
Bug fixes#
Use the satellites of Foreman (1977): the nodal factors of K2, K1, O1 and Mf were wrong by up to 6%.
2026.11.0#
New features#
Add the
devextra with the development tools (pytest,pre-commit,ruffandshapely).Add the Contributing guide, including the release procedure.
Test Python 3.10 to 3.13 in the CI, which installs xoa with pip and the
devextra.Add the
"webmercator"projection, with the"webmerc"alias, toxoa.core.plot.get_projection(): the Web Mercator projection used by the tiles of most web map services.The
xoa.tideanalyses, predictions and diagnostics usexoa.grid.map_along_dim(): the time dimension may be at any position, and the predictions are computed lazily on dask arrays, with up to a third of the memory.Add
xoa.core.tide.predict_currents_complex()to predict tidal currents as complex velocities.Add
xoa.core.plot.get_layer_projection()to get the map projection that suits a background layer.xoa.core.plot.get_strides()acceptszoomto compute automatic strides for a web map without axes, using the newxoa.core.plot.get_webmercator_pixels(): for instance, to subsample the arrows of a web application.xoa.geo.get_geosel()andxoa.geo.GeoSelector.nearest()acceptvalidto select the nearest point among valid points only, such as sea points: either a boolean mask, or"auto"to use the points that have data, as given by the newxoa.geo.get_valid_mask().
Bug fixes#
The sticks of
xoa.plot.plot_stick()andxoa.core.plot.plot_sticks()are no longer tiny by default: the scale is computed by the newxoa.core.plot.get_stick_scale(), so that the strongest sticks span the fraction of the axes width given by the newplot.stick_lengthoption.Maps created by
xoa.plot.create_map(),xoa.plot.plot_field()andxoa.plot.plot_fields()with a WMTS backgroundlayerdefault to the Web Mercator projection of its tiles, so that the tiles are no longer warped, which blurred their text and lines.xoa.core.plot.add_quiverkey()no longer uses thevertsattribute of the quiver key, which is deprecated in Matplotlib 3.11.
Breaking changes#
cartopy,matplotlibanddaskare now required dependencies, and theplotextra is removed.
Documentation#
Clarify the Performance with dask and numba guide, with figures showing the chunks and the dask and numba threads, and add dask to intersphinx.
Add the nearest valid point to Select data at a point, in a box, a circle or a polygon, and the arrows of a web map to Plot fields and currents on maps.
2026.10.0#
New features#
Add uncertainty ellipses at the tip of the arrows of
xoa.plot.plot_vectors()withustd,vstdanduvcorr, based onxoa.core.plot.plot_vector_ellipses()and the numba kernelxoa.core.plot.cov2ellipse().Add
xoa.plot.plot_box(),xoa.plot.plot_circle()andxoa.plot.plot_polygon()to draw the shapes ofxoa.geo.get_geosel(), based on the functions ofxoa.core.plot.Add
xoa.tiles.TileMergerandxoa.tiles.merge_tiles()to merge overlapping tiles of a regular lon/lat grid, with longitude wrapping andlon_range, a memory estimate and warning, and a plot of the tiles on the grid, based on the newxoa.core.tilesnumba kernels. See Merge tiles of a regular grid.Add the
binningmethod toxoa.regrid.regrid1d()andxoa.core.regrid.binning1d(): the average of the input points that fall in each output cell, with a minimal fraction of valid values given byna_thres.xoa.regrid.regrid1d()negates the input coordinate when it has apositiveattribute opposite to the one of the output coordinate, like a depth regridded tozlevels.xoa.regrid.regrid1d()and the 1D kernels ofxoa.core.regridsupport decreasing coordinates, which may also change direction from a column to another. They used to give NaNs.Add the
na_thresargument toxoa.regrid.regrid1d()andxoa.core.regrid.cellave1d(): the minimal fraction of an output cell that must be covered by valid input cells with thecellavemethod.xoa.regrid.regrid1d()andxoa.regrid.extrap1d()no longer move the working dimension last, which makes them faster and lighter, and process dask arrays by blocks withxoa.grid.map_along_dim().xoa.thermdyn.get_n2()also keeps the vertical dimension in place, andxoa.grid.map_along_dim()accepts arrays without the working dimension, like latitudes.xoa.interp.isoslice()keeps it in place too, with a parallel kernel that does not broadcast the arrays: for depths without the time dimension, it is 5 times faster and needs much less memory.Add
xoa.grid.map_along_dim()to apply a function along a dimension that is kept in place, with coordinates of any subset of the dimensions and dask arrays processed withdask.array.map_blocks(), andxoa.core.num.view_along_axis()andxoa.core.num.broadcast_along_axis()to view arrays as(nouter, n, ninner)in numba kernels.Switch from black and flake8 to ruff for linting and formatting, with a pre-commit configuration.
Make public the helpers that were used outside their module:
xoa.core.plot.import_cartopy(),xoa.plot.get_map_axes(),xoa.core.interp.get_source_matrix(),xoa.geo.pop_tree_kwargs()andxoa.dyn.format_uv_docstring(). Addxoa.core.geo.normalize_longitudes(),xoa.core.poly.as_polygons()andxoa.coords.set_name_attrs().Add
xoa.grid.get_lonlat_2d()to get 2D longitudes and latitudes with (y, x) dimensions.Add
plotoptions used as defaults by the plot functions, load options from a file withxoa.load_options()andxoa.set_options, validate options.CBAR_SHRINKbecomesplot.colorbar_shrink. See Configuration.Rewrite the Development roadmap: next diagnostics, and the shoot and armoor ecosystem.
Export
MetaSpecs,SGLocator,MetaVarSpecsandMetaCoordSpecsfromxoa.meta, and fix the API documentation: submodules of thexoa.core,xoa.metaandxoa.tidepackages, objects re-exported by packages, missing modules and wrong references.Add
xoa.tide.set_constituentsto use your own tidal constituents files, globally or within a context, withget_constituents(),get_constituent_names()andreset_constituents(). The constituents are read when needed, andCONSTITUENT_DBandCONSTITUENT_NAMESare removed. See Tidal constituents.Add geographic selection in a box, circle or polygon, or nearest to a point, on rectangular and curvilinear grids and clouds of points:
xoa.geo.get_geosel(),xoa.geo.GeoSelector,xoa.geo.GeoSelection,xoa.geo.with_geosel(), withfitandpadoptions and thexoa.geo.geosel()function and accessor method, based onxoa.core.geo.GeoSelector. See Select data at a point, in a box, a circle or a polygon.Add
xoa.plot.add_layer()andget_layer()to add background layers of WMS and WMTS services, which are defined in the newlayerssection of the config, with theplot.layer*options and thelayerargument ofdecorate_map(). The default layer is the National Geographic map of Esri. Addxoa.get_options().Rename
xoa.plot.create_base_map()andsetup_map_axes()tocreate_map()anddecorate_map(). The old names remain as aliases.Add
xoa.plot.add_fancy_map_frame()and thefancyoption ofxoa.plot.decorate_map(), for a GMT-like black and white frame.Ignore the missing time steps of 1D series in
xoa.tide.harmonic_analysis()andharmonic_analysis_uv().Add cartesian components to
xoa.plot.plot_rose():plot_rose(u, v), with thecartesianandfrom_arguments, and a fallback to the components of a dataset.Add
xoa.plot.add_scalebar()andxoa.plot.add_compass(), with an optional shadow or glow (effect), and thescalebarandcompassarguments ofxoa.plot.plot_field()andplot_grid(). See Plot fields and currents on maps.Add
xoa.dyn.get_u()andxoa.dyn.get_v()with variants, and theugeo,uxandugeosmeta specs (and theirvcounterparts) for eastward, grid-aligned and geostrophic velocities.xoa.tide.harmonic_analysis_uv()uses them with datasets.Add the
xoa.tidesubpackage for tidal harmonic analysis and prediction, ellipses and diagnostics, and plots inxoa.tide.plot, based onxoa.core.tideandxoa.core.signal. See Tides.Move the tidal filters to
xoa.tide.tidal_filter()andxoa.tide.demerliac(). Thexoa.filterversions are deprecated.Add the
xoa.core.filtermodule with the publicget_decimate_arg()anddecimate_by_average()kernels ofxoa.filter.decimate().Add
xoa.plot.plot_rose(),xoa.core.plot.Roseandxoa.core.stats.rose_hist()for wind and wave roses, and therosemethod of theplotaccessor. See Wave roses of a buoy.Add the Pierres Noires wave buoy sample and the
directionalias of the mean wave direction.Add
xoa.grid.vmean()andxoa.grid.vintegrate()for thickness weighted vertical means and integrals.Add the
projectionargument toxoa.plot.plot_grid(), orthographic by default.Add
xoa.plot.PanelLabeler,xoa.plot.add_panel_labels()and thepanel_labelsargument ofxoa.plot.plot_fields()to label panels like “a)”.Add the
parent,locandsizearguments toxoa.plot.plot_minimap()andplot_double_minimap()to inset the minimaps in an axes.Add
cmap="auto"toxoa.plot.plot_field()to choose the colormap from the sign of the data and theplotoptions, and theprettyargument ofxoa.plot.get_label()that writes the units in a nicer way (°C,m s⁻¹).The options functions, like
xoa.get_option()andxoa.set_options(), are now available from thexoapackage, as documented.Add
xoa.core.plot.get_quiverkey_value()andadd_quiverkey(): reference arrows now have a round value (1, 2 or 5 times a power of ten) and are placed above the left corner of the axes, also withxoa.plot.plot_stick(). The Plot fields and currents on maps tutorial is reworked and its minimaps no longer enlarge the figures.Add
xoa.dyn.get_rossby_radius(), a quick WKB estimate of the first Rossby radius of deformation. See Vertical modes of the Gulf Stream.Add
xoa.krig.LocalKriger, which krigs with the nearest points only using the newSphericalKDTreeand the numba kernels ofxoa.core.krig. See Interpolate scattered data with kriging and Map the Gulf Stream temperature from sparse observations.Add
xoa.coords.geo_unstack()to restore the grid of an object stacked withgeo_stack(), and itssingletonargument. The stacked dimensions are now in a fixed order, latitude first.Add
xoa.krig.ClusteredKriger, which now holds the clusterization (npmaxandnproc) that moved out ofxoa.krig.Kriger.Add
xoa.geo.GeoKDTreeandxoa.geo.get_neighbors()to find the nearest points or those within a distance, also asxoaaccessor methods with a cached tree, based on the newxoa.core.geo.SphericalKDTree. See Find neighbors on the sphere.Add the
xoa.dyndiagnosticsget_relvort(),get_div(),get_strain(),get_okuboweiss(),get_coriolis()andget_geos(), also available asxoaaccessor methods, with numba kernels in the newxoa.core.dynmodule. Grid resolution comes fromxoa.grid.get_dx_dy().Add
xoa.dyn.get_cyclogeos(), an iterative cyclogeostrophic solver after Penven et al. (2014), with full (smoothed) advection terms or the two classic ones withterms="penven".The
xoa.dyndiagnostics accept a variable vertical coordinatezto compute horizontal derivatives at constant depth. See the Rossby number on the sigma levels of a CROCO simulation tutorial.Add
xoa.dyn.VerticalModesto compute vertical modes, speeds and deformation radii, and to decompose and recompose profiles, based on the newxoa.core.modesmodule. See Vertical modes of the Gulf Stream.Add the
temp_kindandsal_kindarguments toxoa.thermdyn.get_n2()andtemp_kindtomixed_layer_depth(), andxoa.thermdyn.convert_temp()andconvert_sal(), based on the newxoa.core.thermdyn. Theatempvariant is dropped.Add
xoa.thermdyn.get_n2()for the squared Brunt-Vaisala frequency, andxoa.coords.as_z()to get a vertical coordinate as z, positive up.Add the
xoa.numbersmodule withget_rossby(),get_burger(),get_froude()andget_ekman().xoa.dyn.get_rossbymoved to it, without backward compatibility. See Dimensionless numbers of the Gulf Stream.Add
xoa.stats.StatAccumto accumulate temporal and spatial statistics, with automatic vertical and horizontal weights, dump and restart, based on numba moments inxoa.core.stats. See Accumulating statistics.Add
xoa.grid.dz2z(),xoa.grid.z2dz(),xoa.grid.get_dz(),xoa.grid.get_dz_terms()andxoa.grid.decode_dz2z(), and thepositiveanderrorsarguments ofxoa.coords.get_positive_attr().xoa.coords.get_z()now relies ondecode_dz2z(). Fixxoa.grid.decode_dz2depth()with a bathymetry or a sea surface height andpositive="down".Add the References page.
Add
xoa.mask.get_polygon_mask(), also anxoaaccessor method, to flag grid cells inside polygons with a coverage threshold, based on the newxoa.core.maskandxoa.core.polynumba functions.Add
xoa.plot.plot_fields()to plot several fields on maps of a single figure, with a shared colorbar if needed.Add the
normalizeparameter toxoa.dyn.get_div(),get_strain()andget_okuboweiss().Add
xoa.mask.get_common_mask(),xoa.stats.rms()andxoa.poly.get_contour_polygons(), with the newxoa.statsandxoa.polymodules.Add the
energy_share()andtruncation_error()methods toxoa.dyn.VerticalModes.Add
xoa.plot.plot_vectors()andxoa.core.plot.plot_vectors()to draw currents as under-sampled arrows.The
mercatornaming specifications are also used for GLORYS.Add the
ref="surface"argument toxoa.sigma.decode_sigma(), thedecode_sigmaaccessor and the ocean sigma functions, to get heights relative to the free surface instead of the fixed datum. The core functions ofxoa.core.sigmatake a newdatumargument, andxoa.coords.to_z()andxoa.coords.to_depth()keep thexoa_vertical_refattribute.Add
xoa.coords.copy_coord_attrs()to restore coordinate attributes afterxarray.apply_ufunc().Add the
zcoordinate (positive up) as distinct fromdepth(positive down):zmeta spec,xoa.coords.get_z(),is_z(),to_z(),to_depth(),reverse_dim()and thexoa.get_zaccessor method.get_depth()andget_z()fall back on each other and flip the sign when needed.Add
xoa.core.plot.get_projection()to get a map projection from an instance, a cartopy lower case name or the"merc","pc"and"ortho"aliases. The default ofxoa.plot.plot_grid()is"ortho", centered on the grid.The main
xoaaccessor is now registered whenxoais imported.Add the
xoa.core.interp.XYInterpolatorandxoa.core.regrid.XYRegriddernumba classes for horizontal bilinear, bicubic and conservative interpolation and regridding, with their kernels in the newxoa.core.splineandxoa.core.conservmodules.Add the
xoa.interp.Interpolatorandxoa.regrid.Regridderxarray classes for horizontal (and temporal) interpolation and regridding, with thexoa.coords.geo_merge()andxoa.grid.ds2grid_dict()helpers.The methods of
xoa.interp.Interpolatorandxoa.regrid.Regridderare listed in thexoa.interp.xy_interp_methodsandxoa.regrid.xy_regrid_methodsenums, that accept aliases like"linear".xoa.regrid.regrid1d()andxoa.regrid.extrap1d()now accept datasets: only variables that have the working dimension are processed.Add the
xoa.grid.get_resolution(),xoa.grid.get_median_resolution()andxoa.grid.get_edge_extents()functions, and their numpy counterpartsxoa.core.grid.compute_resolution()andxoa.core.grid.median_resolution_deg().Add the plotting helpers
xoa.plot.plot_field(),xoa.plot.plot_grid(),xoa.plot.plot_section(),xoa.plot.plot_stick(),xoa.plot.get_label(),xoa.plot.create_base_map(),xoa.plot.setup_map_axes()andxoa.plot.add_land(). Their inputs are found withxoa.meta.The weights of
xoa.interp.Interpolatorandxoa.regrid.Regridderare computed only once for the same grids, points and parameters: they are shared between the objects, and thus between the calls of thexoaaccessors on the variables of a dataset. Thexoa.interp.clear_weights_cache()andxoa.regrid.clear_weights_cache()functions free them.The weights files of
xoa.interp.Interpolatorandxoa.regrid.Regridderare now netcdf files with one group per grid and method, named after a fingerprint of the grids, so that a single file serves all your grids, the weights are found automatically and cannot be loaded for other grids. A group is added to the file when it is not found. Files in the previous format are still read, with a warning, but the grids cannot be checked. See the newxoa.weightsmodule.The fingerprint of a grid is available with
xoa.grid.get_fingerprint(), and from thesrc_fingerprint,dst_fingerprint,fingerprintandweights_groupattributes ofxoa.regrid.Regridderandxoa.interp.Interpolator. Thexoa.weights.find_groups()andxoa.weights.describe_groups()functions find and describe the weights of a grid in a weights file.Add the
xoa.misc.get_array_fingerprint()andxoa.misc.combine_fingerprints()functions and thexoa.misc.SmallCacheclass.Add the
xoa.plot.add_colorbar()andxoa.core.plot.add_colorbar()functions that add shrunk colorbars, labelled from the data array, which are used by all the colorbars ofxoa.plot.Add the
xoa.core.plotmodule with the low level plotting routines that work on numpy arrays and axes, likexoa.core.plot.plot_mesh(),xoa.core.plot.plot_depth_section()andxoa.core.plot.plot_sticks(), which are used by the high level functions ofxoa.plot.xoa.plotimports cartopy lazily, only when a map is drawn.Add the
xoa.regrid.regridxy()andxoa.interp.interpxy()functions, that build and apply a regridder or an interpolator in a single call, or reuse one that is passed to them. Theinterpandregridmethods of thexoaaccessors are now based on them.Add the
interpandregridmethods to thexoaaccessors.Add the
xoa.core.grid,xoa.core.polyandxoa.core.timemodules.Add Taylor diagrams with
xoa.plot.plot_taylor()for xarray objects, and thexoa.core.plot.TaylorDiagramclass andxoa.core.plot.plot_taylor()function for numpy arrays, with labels, markers, colored values and negative correlations. The numba statistics are computed byxoa.core.stats.taylor_stats()of the newxoa.core.statsmodule.Speed up
xoa.grid.pad(),get_centers(),get_edges(),shift(),diff()andxoa.core.grid.centers2edges()for floats with numba kernels, up to 4 times faster on large grids.Add the
"constant"and"wrap"modes toxoa.grid.pad(), andxoa.grid.gradient()for derivatives with respect to a 1D or nD coordinate.
Breaking changes#
The shadows are more transparent: the default
alphagoes from 0.3 to 0.15 for the map decorations and theplot.shadow_alphaoption from 0.5 to 0.3.xoa.core.interp.isoslice()is no longer a generalized ufunc: it takes anaxisargument, which is the last one by default, and returns the result.The
cellerrmethod ofxoa.regrid.regrid1d()is removed: it has not been working since the Fortran routines were replaced by numba ones.The 1D kernels of
xoa.core.regrid(nearest1d(),linear1d(),cubic1d(),hermit1d()andcellave1d()) no longer take aneshapesargument: they take arrays that are broadcasted like with numpy except along anaxis, which is kept in place.extrap1d()also takes anaxis. Thedaskargument ofxoa.regrid.regrid1d()andxoa.regrid.extrap1d()is no longer used.xoa.sigma.decode_sigma()and theocean_*functions ofxoa.sigmanow return azarray, which is positive up, instead of adeptharray that was negative.xoa.grid.dz2depth()andxoa.grid.decode_dz2depth()return azarray whenpositive="up", andxoa.grid.decode_dz2depth()no longer overwrites a dimension coordinate that has the same name. Usexoa.coords.get_depth()to get a depth.xoa.coords.get_vertical()now uses the meta specs of its argument and looks for a depth, azand then an altitude. Thezname is no longer an alternative name of thelevelcoordinate, and thezentry of thehycomconfiguration is now adepthentry.xoa.grid.get_edges()now extrapolates the outer edges linearly by default (mode="linear_extrap") instead of replicating the end values. Passmode="edge"to recover the previous behaviour. This also changes the edges inferred by thecellavemethod ofxoa.regrid.regrid1d().The minimal version of xarray is now 2024.6, which provides the
on_missing_core_dimargument ofxarray.apply_ufunc()used to interpolate and regrid datasets.xoa.grid.to_rect()now relies onxoa.core.grid.check_grid_type()and converts a longitude and the latitude that shares its dimensions together, only if the grid is not curvilinear.
Deprecations#
xoa.core.interp.grid2rellocs()is deprecated, usexoa.core.spline.compute_frac_indices()orxoa.core.interp.XYInterpolatorinstead.xoa.core.interp.cell2relloc()is deprecated, usexoa.core.geo.relative_cell_coords()instead (vertices 2 and 4 are swapped).xoa.core.interp.closest2d()is deprecated, usexoa.core.geo.closest_point_fast()instead.
Bug fixes#
xoa.grid.apply_along_dim()failed with datasets since xarray 2025.09.1, whosexarray.Dataset.update()returns None.Fix
xoa.grid.map_along_dim()when an output coordinate has a coordinate named like the working dimension, and importcmoceaninxoato register thecmo.*colormaps.The
bottomandtopextrapolation modes of thecellavemethod ofxoa.regrid.regrid1d()were ignored.The
conservargument ofxoa.regrid.regrid1d()was ignored by thecellavemethod. The conservative regridding also gives NaN instead of 0 where there is no valid input.The
biasandtensionarguments ofxoa.regrid.regrid1d()were ignored by thehermitmethod, anddrop_nawas not rejected by thecellavemethod.xoa.regrid.extrap1d()failed with dask arrays of more than one dimension.The
cellavemethod ofxoa.regrid.regrid1d()gave random results when the output coordinates have a dimension that the data does not have.Fix the
-hand--short-helpoptions ofxoa.cfgm.ConfigManager.arg_parse(), which lost the options section since python 3.10, andarg_long_help(), which failed.xoa.cfgmno longer uses the privateargparse._HelpAction.Draw the outline of 2D grids with
plot_coords="auto"inxoa.plot.plot_minimap()instead of all the points, and defaultcoords_linewidthto 1.5.Fix the Greenwich phases of
xoa.tide: astronomical arguments 12 h off, M2/N2/2N2 nodal satellites, and the 90° shifts of the diurnal constituents. They now agree with utide at Brest within 0.5° for the main constituents.Search the time dimension and the variables of
xoa.tidewithxoa.coordsandxoa.meta:t_dimandtime_dimdefault to None,harmonic_analysis()andharmonic_analysis_uv()accept datasets, andvalid_timeis a known time name.The legend of
xoa.core.plot.Roseis no longer cut off by the figure edge.Fix
xoa.grid.pad(),get_centers(),get_edges(),shift()anddiff()for longitudes across the dateline.Fix
xoa.grid.apply_along_dim(), whose extra keywords were modified by the coordinate ones.Fix the bilinear and bicubic interpolation and regridding of regular grids that span more than 180°, which gave missing values, and of global grids, whose cells between the last and first columns are now interpolated. Longitudes out of [-180, 180], like 0-360, are now accepted for grids and points.
Fix
xoa.filter.tidal_filter()with series that are sampled more than hourly, and the unit of its error message.Fix the white margins of the figures of
xoa.plot.plot_grid(), whose size now follows the aspect ratio of the map, and usecmo.deepfor its bathymetry.Fix
xoa.dyn.flow2d()with a dataset of initial positions, which used the longitudes for the latitudes, andxoa.plot.plot_flow()with missing values in the currents.Fix
xoa.geo.get_distances()for a single set of points, which had two dimensions of the same name, nownpts0andnpts1, and clarify the angle ofxoa.geo.bearing().Fix
xoa.plot.add_lightshading(), which gave black objects with recent versions of matplotlib, with a defaultfractionof one.Fix the thin last row and column of the under-sampled grids of
xoa.plot.plot_grid(): the drawn edges are now evenly spread with the first and last ones kept.Fix
xoa.color.CmapAdapterwithout specs, which made thecmapvalidation function ofxoa.cfgmcrash, and its invalid specs, which now raise an error.Fix
xoa.krig: simple kriging now uses the covariance, block kriging averages per point,empirical_variogram()no longer fails when undersampling, drops pairs at the same distance or overwrites the long name, a fittedVariogramModelis not fitted again and the first variable of a dataset is used to fit it. The krigers now return the grid or the dimensions of the target with its coordinates and their attributes, and the attributes of the input data, and accept a single position. The kriging error is now named variance, and it is conservative for theClusteredKriger. The latter andxoa.geo.clusterize()accept aseedfor reproducible clusters. The kriging matrices are factorized (Cholesky or LU) instead of inverted, with a pseudo inverse for singular ones, and the fitted nugget is at least1e-6of the sill.The
set_meta_specsmethod of thexoaaccessors accepts the same arguments asxoa.meta.set_meta_specs, like a name or a dict.Fix
xoa.krig.Krigerthat computed the distances between input points in meters whatever its dist_units.xoa.coords.get_depth()no longer fails when it has to decode a dataset, and no longer warns whenerrors="ignore".Fix the
decode_sigmasubaccessor of thexoaaccessor of datasets, that returnedNone.Fix
xoa.sigma.decode_sigma()that silently overwrote the heights at rho levels with those at w levels of CROCO. It now raises an error when two heights have the same name, and heights are namedz_rhoandz_wwith thecrocospecs, as the location is also parsed from the name of the sigma variable.Fix the meta appendix: the meta configurations are no longer called specifications, the specifications provided by the internal
meta.inifile have their own page, and the details pages of the configuration items are not listed in the left table of contents anymore.Fix the bilinear and bicubic interpolation with
skipna=Trueandna_thres=0, that set isolated points to nan because of rounding errors in the sum of the weights of valid neighbours.Fix the conservative weights of the cells that cross the dateline or that are on the other side of it, which were missing. Longitudes of the cells are made continuous before computing their overlaps, with
xoa.core.poly.unwrap_longitudes()andxoa.core.grid.unwrap_grid_longitudes().Fix the points that are on the first and last lines of a regular source grid, that were NaN on the last one and extrapolated up to one cell before the first one, with the bilinear and bicubic methods. Cells are now closed and what is outside is NaN on all sides.
Fix the bicubic method that returned NaN for the points that are exactly on the second and last but one lines of a rectangular grid, whereas they are valid on a regular grid.
Fix the interpolation on rectangular grids, which have an irregular spacing, whose latitudes decrease along their dimension, that gave NaN everywhere, and a longitude search that wrongly found points that are on the opposite side of the globe of a cell that crosses the dateline.
Fix the interpolation on curvilinear grids that cross the dateline, that gave NaN or wrong values near it.
Fix the search of the closest node of large curvilinear grids, that missed the cell of some points of the inside of the grid (0.1% on a 400 x 400 grid): the closest node of a subsampled grid is now refined by walking downhill instead of searching a window of fixed size, and invalid nodes trigger a full search.
Fix the conservative weights that were silently truncated to ten links per source cell, so that regridding to a much finer grid gave wrong values, and make their computation much faster with an index of the source cells, instead of testing all the pairs of cells.
xoa.core.grid.check_grid_type()no longer warns for a grid with a single row or column.xoa.interp.Interpolator.interp_with_time()no longer renames an unnamed data array.xoa.plot.plot_ts()only adds a colorbar automatically when the scatter colors are a data array, and not a numpy array, and its colorbar is now shrunk and labelled like the others. Its axis labels are built withxoa.plot.get_label().Fix a data race in
xoa.core.interp.closest2d()(parallel scan writing to shared accumulators) that madexoa.interp.grid2loc()silently return wrong results, or crash, on genuinely curvilinear (non-separable) grids.Remove
fastmath=Truefromxoa.core.interp.closest2d(),xoa.core.interp.cell2relloc()andxoa.core.interp.grid2relloc(): it could break the NaN-skip comparisons these functions rely on to ignore invalid/land-masked grid points, silently returning a wrong result.
Documentation#
Add a gallery of tutorials grouped in categories (graphics, grids, vertical, regridding, filtering, dynamics, tides, meta, config and evaluation), with consistent and compact figures and links to the xoa objects. See Tutorials.
Add the Dynamics diagnostics and polygon masks, Vertical coordinates: z and depth, Tides, Horizontal interpolation and regridding, Plotting fields, grids and sections, Accumulating statistics and Performance with dask and numba guides, and the tide appendix. The Metadata, CF and naming conventions and Config management with xoa.cfgm guides are shorter.
Add a tour of xoa to the Quick start guide.
List the
get_neighbors,get_geoselandgeoselaccessor methods.
2026.7.0#
Bug fixes#
Remove the
xoa reset_cf_cacheCLI command: the disk cache no longer exists inxoa.metaand the command was raisingAttributeErrorat runtime [PR117].
2026.2.0#
New features#
Add the
withinparameter toxoa.cfsearch methods.Add the
rename_argsargument to formatting routing ofxoa.metato retrieve renaming information [PR102].Add the
xoa.dyn.get_sea_level()function to get either SSH, ADT, SLA or MDT in a dataset [PR102].Allow passing a list of “meta_name” to
xoa.cf.MetaSpecs.get()for enlarging a search [PR102].The
xoa.data_samplesmodule now use Pooch to manage sample files [PR111].Add the
multiparameter toxoa.misc.Choicesto allow multiple choices [PR111].
Deprecations#
The
xoa.cfmodule is deprecated. Usexoa.metainstead. All references to “cf” must be converted to “meta” in modules, functions, classes, methods and accessors. A backward compatibility layer has been added [PR111].The
xoa.cf_configsmodule is deprecated in favour of modulexoa.meta.configs[PR111].Pure core regridding 1D function of the
xoa.core.interpmodule are moved toxoa.core.regridmodule.
Bug fixes#
Fix
xoa.coords.get_time()that was returning None.Fix
xoa.interp.linear1d()extrapolation [PR107]Fix
xoa.grid.to_rect()warnings.Fix
test_accessors.pyto usemetaaccessor instead of deprecatedxmetaandmeta_specsproperty instead ofmetaspecs.Fix examples to use
xoa.get_meta_config_file()instead of deprecatedget_cf_config_file.
Documentation#
Rename “Using the modules” section to “In-depth guides”.
Added in the in-depth guide to metadata mentions of
xoa.coords,xoa.dynandxoa.thermdynhelper function to access coordinates and physical variables like lon or temp.Added in-depth guides about sigma-like coordinates, grids and regridding, and filtering.
0.8.0 (2025-05-12)#
New features#
Add modules
xoa.data_samplesandxoa.cf_configs.xoa.cf.CFSpecs,xoa.cf.register_cf_specs(),xoa.cf.get_cf_specs()andxoa.cf.set_cf_specsnow accepts short names of internal CF config like “croco” or “argo”.Add absolute option for salinity and the ref_dens option to enable using different formulae for density to
xoa.plot.plot_ts().Add the exclude_names option to
xoa.cfconfigurations to ignore data array names.Call
xoa.cf.infer_cf_specs()fromxoa.cf.get_cf_specs()when a data array or dataset is passed [PR96].Add the drop_na and maxgap parameters to the
xoa.regrid.regrid1d()function to fill gaps [PR92].Add the
xoa.filter.tidal_filter()function to apply a tidal filter to a time series [PR87].
Breaking changes#
xoa.cf.CFSpecs()tests the generic pivot name last, not first.The
xoa.cf.CFSpecs.decode()method no longer sets the “cf_specs” encoding [PR96].The default
name_formatoption of thesglocatorsection of the meta specifications is set to False to prevent parsing the grid location in names [PR96].xoa.filter.tidal_filter()raises anXoaErrorinstead of a simple warning when the time step is greater than an hour.xoa.regrid.regrid1d(): extrapolation from input data instead of output data [PR91].
Deprecations#
Now using
platformdirsinstead ofappdirs.xoa.filter.demerliac()is deprecated, usexoa.filter.tidal_filter()instead [PR88].
Bug fixes#
Fix
xoa.cf.infer_cf_specs()that was missing attributes and encoding [PR96].Fix
xoa.plot.plot_ts()that now uses absolute salinity along with potential temperature and potential density anomaly formulas.Fix lat keyword in
deg2m()andm2deg()which now accepts arrays.Fix weighting of
xoa.filter.convolve().Fix
xoa.grid.to_rect()raising of errors and handling of missing data in coordinates.Fix string formatting in
xoa.filter.tidal_filter()warning.Fix default value of deltadens in
xoa.thermdyn.mixed_layer_depth().
Documentation#
Now using Sphinx book theme
0.7.1 (2023-07-21)#
New features#
Add support for not creating multi-indexes in
xoa.coords.geo_stack().
Bug fixes#
Fix
xoa.geo.get_distances()that was not able to handle multi-indexes fromxoa.coords.geo_stack().Fix doc generation [PR83].
Fix
xoa.sigma.get_cs()to keep it compatible with pure numpy arrays
Documentation#
Add a link to the github repository.
0.7.0 (2023-07-17)#
New features#
Add issue and pull request templates.
Add the
xoa.filter.smooth()function [PR76].Improved the default sig and std parameter values for filter windows that accept them [PR76].
Add the
xoa.plot.plot_minimap()andxoa.plot.plot_double_minimap()functions to display the geographic situation of a set of coordinates [PR73].Add support for the min_extent keyword to
xoa.geo.get_extent()[PR73]Add dask support to
xoa.sigmasigma to depth converters [PR72].Add the
xoa.nummodule that contains low level numeric utilities.Add the
xoa.thermdyn.mixed_layer_depth()function to compute the mixed layer depth with three different methods [PR67, PR75].Add the
xoa.thermdyn.is_temp(),xoa.thermdyn.is_sal()andxoa.thermdyn.is_dens()functions to infer if an array of temperature, salinity or density type, and added the relatedxoa.thermdyn.get_temp(),xoa.thermdyn.get_sal()andxoa.thermdyn.get_dens()function to search in datasets[PR67, PR79].Add kernel_kwargs keyword to
xoa.filter.convolve()to better control the kernel generation byxoa.filter.generate_kernel()[PR64].Add inference of parameters for some window functions, like the gaussian shape, in
xoa.filter.get_window_func()[PR64].Add
xoa.regrid.isoslice()based onxoa.interp.isoslice()core function [PR63].
Breaking changes#
get_window_func()now accepts only one positional argument and all other arguments must be named.
Bug fixes#
Fix
xoa.cfgm.is_boolstr()which now supports the newconfigobj.Fix broadcasting
xoa.interp1d interpolation routines [GH69].Fix
xoa.sigma.get_sigma_terms()so that it works in case of multiple levels coordinates [PR60].Fix
xoa.grid.to_rect()that now infers coordinates and can emit a warning or raise an error.
Documentation#
Add an example of xoa.plot.plot_double_minimap to Compare Mercator to ARGO and Compare Hycom3d with a GDP drifter examples [PR73].
Add an example of xoa.thermdyn.mixed_layer_depth to Interpolate a meridional section of CROCO outputs to regular heights example [PR67].
0.6.1 (2022-02-24)#
New features#
Add a warning to
xoa.open_data_sample()that is emitted when the requested file is not an internal data sample [PR47].Add the
xoa.plot.add_shadow(),xoa.plot.add_glow()andxoa.plot.add_lightshading()function to add path effects to plots [PR44].Add the
xoa.plot.plot_ts()function to make T-S diagrams [PR43].Add the
xoa.filter.demerliac()function to apply a Demerliac filter to a time series [PR41].Add support for fine tuning masking in
xoa.filter.convolve()through the na_thres parameter [PR41].Add the
xoa.geo.cdist()andxoa.geo.pdist()functions to compute haversine distances respectively between two dataset and with a dataset [PR40].Add the
xoa.coords.geo_stack()function to stack longitudes and latitudes into another dimension, in a dataset or data array [PR40].Add the
xoa.filter.decimate()function to crudely undersample a geographic dataset or data array with a radius of proximity [PR40].Add the
xoa.geo.get_distances()to compute the Haversine distances between locations inside a single dataset or between two datasets [PR40].Add the
xoa.krig.empirical_variogram()function to estimate variogram parameters.Add the
xoa.krig.VariogramModelto manage a variogram model [PR40].Add the
xoa.krig.Krigerandxoa.krig.krig()to perform kriging [PR40].Add the exclude option to data var and coordinate specifications of
xoa.cf.CFSpecsinstances [PR38].
Breaking changes#
A single Nan now contaminates the data over the kernel emprise in
xoa.filter.convolve()since na_thres is set to zero by default [PR40].xoa now requires the
gswpackage.
Bug fixes#
Fix
xoa.regrid.regrid1d()so that it works now with time coordinates [PR48].Fix
xoa.regrid.grid2loc()so that it works with scalar output coordinates.Fix
xoa.regrid.regrid1d()to prevent conflict in the presence of MultiIndexes.Fix search for coordinates that are hidden due to
xarray.DataArray.stack().
Documentation#
Add the Compare Mercator to ARGO example.
0.6.0 (2022-02-24)#
Empty with non existing tag.
0.5.1 (2021-10-13)#
New features#
Switch the CI workflow to github [PR36].
Bug fixes#
Fix
xoa.cf.CFSpecs.to_loc()that was failing with dataset [PR23].
0.5.0 (2021-10-12)#
New features#
Add the hlocs argument to
xoa.sigma.get_sigma_terms()andxoa.sigma.decode_cf_sigma()to decode at several horizontal staggered grid locations [PR34].Add the edges argument to
xoa.regrid.regrid1d()to manually specify the edges that are used by the “cellave” regridding method [PR34].Add back the loc argument to the formatting methods of
xoa.cf[PR34].Add dimension checking and support for dask arrays in
xoa.sigma[PR34].Expose a few options of
xoa.cfgm.ConfigManager()to thexoa.cfgm.cfgargparse()function.Add the
cfgm_cfg_filesphinx configuration option to save the default configuration of axoa.cfgm.ConfigManager().
Bug fixes#
Fix
xoa.cf.SGLocator.parse_attrparsing since regular expressions were not matching full strings.Fix
xoa.regrid.regrid1d()with “cellave” method [PR34].Fix
xoa.cf.CFSpecs.get_location_mapping()for coordinates that have no axis attribute specifications [PR34].Fix
xoa.grid.dz2depth()that was not working properly with 4D+ arrays [PR34].
Breaking changes#
The default name_format of
xoa.cf.SGLocatorno longer contains the location pattern {loc} to prevent unwanted location catching.The loc argument of
xoa.sigma.get_sigma_terms()is renamed vloc [PR34].
0.4.0 (2021-09-02)#
New features#
xoa.cf.CFSpecs.decode()better supports staggered grids.xoa.cf.CFSpecs.search_dim()supports generic names in addition to dimension types as second argument.Add the
xoa.cf.CFSpecs.match_dim()method to check if a given dimension name is known.Add the
reloc()andto_loc()methods toxoa.cf.CFSpecsfor quickly changing the staggered grid indicators in names.Add the
xoa.cf.SGLocator.add_loc()method to quickly change the location markers in a data array.
Breaking changes#
xoa.coords.get_dims()is renamed toxoa.coords.get_cf_dims().The name argument of
xoa.cf.CFSpecsmethods is renamed to cf_name, and the dim_type(s) argument is renamed to cf_arg(s).xoa.cf.SGLocator.get_location()is renamed toget_loc_from_da()and theget_loc()is added.
Bug fixes#
Fix the output formatting of
xoa.grid.dz2depth().
Documentation#
The Metadata, CF and naming conventions section and Compare Hycom3d with a GDP drifter example are adapted to reflect changes.
v0.3.1 (2021-05-21)#
New features#
Add an autolim keyword to
xoa.plot.plot_flow()to speedup the processing with cartopy maps.
Breaking changes#
Rename the cf and sigma keyword of
xoa.register_accessors()respectively to xcf and decode_sigma to match the default name of accessors.Rename the sigma accessor to decode_sigma.
Bug fixes#
Fix the access to the xoa executable on windows.
Fix the minimal version for xarray [PR23].
Documentation#
Add a “How to start” section.
Accessors are now documented separately with sphinx-autosummary-accessors [PR20].
The Hycom-GDP example now uses
xoa.plot.plot_flow().
v0.3.0 (2021-05-12)#
New features#
Add the
xoa.plot.plot_flow()function [PR9].Improve
xoa.coords.get_depth()so that it can compute depth from sigma coordinates or layer thicknesses [PR8].Add the
xoa.dyn.flow2d()function [PR7].Add the
xoa.regrid.extrap1d()function.Add the
xoa.filter.erode_coast()function which is specialized version of thexoa.filter.erode_mask()for horizontal data.Add the
xoa.coords.get_xdim(),get_ydim(),get_zdim(),get_tdim()andget_fdim()for quickly finding standard dimensions.
Bug fixes#
Fix u and v CF config [PR6]