Changes in 1.8.0
Enhancements
-
The method
xcube.core.GridMapping.transform
now supports lazy execution. If
computations based on actual data are required—such as determining whether the
grid mapping is regular or estimating the resolution in the x or y direction—only a
single chunk is accessed whenever possible, ensuring faster performance. -
The function
xcube.core.resampling.rectify_dataset
now supportsxarray.Datasets
containing multi-dimensional data variables structured asvar(..., y_dim, x_dim)
.
The two spatial dimensions (y_dim
andx_dim
) must occupy the last two positions
in the variable's dimensions. -
Added a new preload API to xcube data stores:
- Enhanced the
xcube.core.store.DataStore
class to optionally support
preloading of datasets via an API represented by the
newxcube.core.store.DataPreloader
interface. - Added handy default implementations
NullPreloadHandle
andExecutorPreloadHandle
to be returned by implementations of theprepare_data()
method of a
given data store.
- Enhanced the
-
A
xy_res
keyword argument was added to thetransform()
method of
xcube.core.gridmapping.GridMapping
, enabling users to set the grid-mapping
resolution directly, which speeds up the method by avoiding time-consuming
spatial resolution estimation. (#1082) -
The behaviour of the function
xcube.core.resample.resample_in_space()
has
been changed if notile_size
is specified for the target grid mapping. It now
defaults to thetile_size
of the source grid mapping, improving the
user-friendliness of resampling and reprojection. (#1082) -
The
"https"
data store (store = new_data_store("https", ...)
) now allows
for lazily accessing NetCDF files.
Implementation note: For this to work, theDatasetNetcdfFsDataAccessor
class has been adjusted. (#1083) -
Added new endpoint
/viewer/state
to xcube Server that allows for xcube Viewer
state persistence. (#1088)The new viewer API operations are:
GET /viewer/state
to get a keys of stored states or restore a specific state;PUT /viewer/state
to store a state and receive a key for it.
Persistence is configured using new optional
Viewer/Persistence
setting:Viewer: Persistence: # Any filesystem. Can also be relative to base_dir. Path: memory://states # Filesystem-specific storage options # StorageOptions: ...
-
The
get_data_ids()
method inDataStore
has an enhancedinclude_attrs
parameter.
Previously accepting onlyContainer[str]
, it now also supports abool
value.
Settinginclude_attrs
toTrue
retrieves all attributes of the data_ids. -
Updated dependency
urllib3
to be>=2.0
. -
Bundled xcube-viewer 1.4.0
Fixes
- The function
xcube.core.resample.resample_in_space()
now supports the parameter
source_ds_subset=True
when callingrectify_dataset
. This feature enables
performing the reprojection exclusively on the spatially congruent subset of
the dataset. - The function
xcube.core.resample.resample_in_space()
now always operates
lazily and therefore supports chunk-wise, parallel processing. (#1082) - Bug fix in the
has_data
method of the"https"
data store
(store = new_data_store("https", ...)
). (#1084) - Bug fix in the
has_data
method of all filesystem-based data store
("file", "s3", "https"
).data_type
can be any of the supported data types,
e.g. for.tif
file,data_type
can be eitherdataset
ormldataset
. (#1084) - The explanation of the parameter
xy_scale
in the method
xcube.core.gridmapping.GridMapping.scale
has been corrected. (#1086) - The spurious tileserver/viewer warning "no explicit representation of
timezones available…" (formerly "parsing timezone aware datetimes is
deprecated…") is no longer generated. (#807)
Other changes
-
Added experimental feature that allows for extending the xcube Viewer
user interface with server-side panels. For this to work, users can now
configure xcube Server to load one or more Python modules that provide
xcube.webapi.viewer.contrib.Panel
UI-contributions.
Panel instances provide two decoratorslayout()
andcallback()
which are used to implement the UI and the interaction behaviour,
respectively. The functionality is provided by the
Chartlets Python library.
A working example can be found inexamples/serve/panels-demo
. -
The xcube test helper module
test.s3test
has been enhanced to support
testing the experimental server-side panels described above:- added new decorator
@s3_test()
for individual tests withtimeout
arg; - added new context manager
s3_test_server()
withtimeout
arg to be used
within tests function bodies; S3Test
,@s3_test()
, ands3_test_server()
now restore environment
variables modified for the Moto S3 test server.
- added new decorator
Full Changelog: v1.7.1...v1.8.0