Changelog for Metview's Python interface
- added support for numpy 2.0
- added helper functions to aid automatic conversion from Macro to Python
- added support for reading PNG files
- added string() function from Metview
- fixed warning message in select() method with pandas 2.2
- Added arguments() function to mimic the behaviour of the Macro function of the same name
- Fixed case of mean(dim=...) where the input fieldset is not a complete hypercube
- Fieldset function stdev() now accepts 'dim' argument to compute over given dimension
- added new function plot_xs_avg() to provide high-level plotting interface for average cross sections
- Fixed issue where functions that take numpy arrays as input did not work properly with multi-dimensional arrays
- fixed memory leaks when passing strings, numbers and dates from the binary layer to the Python layer
- Fieldset functions mean() and sum() now accept 'dim' argument to compute over given dimension
- function gallery.load_dataset() now downloads from a new server
- added new functions smooth_n_point() and smooth_gaussian() to perform spatial smoothing on fieldsets with lat-lon grids
- added new function convolve() to perform spatial 2D convolution on fieldsets with lat-lon grids
- add 'reverse' and/or operators between Fieldsets and bools (e.g. 'True & my_fieldset')
- fixed issue where automatic indexing of a dataset fails
- make fieldset parameter selector operator work in pure Python Fieldset
- make vector data extraction operator work for 100m and 200m wind
- select(): do not try to interpret shortName values as vector field names
- select(): do not apply sorting on results
- Fieldsets: add sort method based on indexed metadata
- select(): fix issue where cannot filter by date when data date has no year component (e.g. monthly climatologies)
- Requests: allow True/False as argument values when creating Requests
- fix for automatic indexing of dataset
- experimental pure Python implementation of Fieldset - for internal testing at the moment
- the plot functions now automatically plot inline if running inside a Jupyter notebook - it is no longer necessary to call setoutput('jupyter') - call setoutput('screen') to force the interactive plot window to appear
- inline plots in Jupyter notebooks will be automatically trimmed of surrounding whitespace if pillow is installed
- new functions to build popup dialogs and read in user input. Available via the newly added ui module. - ui.dialog() - ui.any() - ui.colour() - ui.icon() - ui.option_menu() - ui.slider() - ui.toggle()
- added high-level plotting functions to be used with Datasets or in Jupyter notebooks - plot_maps() - plot_diff_maps() - plot_xs() - plot_rmse()
- new object Track to represent a storm track
- new function make_geoview() to generate a geoview object with predefined settings
- new interface for Datasets - a Dataset represents a collection of data files (GRIB and CSV) and a set of predefined styles to visualise the data. Ideal for training courses or case studies. - see Jupyter notebook example at https://metview.readthedocs.io/en/latest/notebook_gallery.html
- added new keyword argument called check_local to gallery.load_dataset(). If it is True and the data file exists locally it will not be downloaded.
- fixed issue when describe() crashed when called with a paramId
- fixed case where map_area_gallery() crashed
- fixed case where map_style_gallery() crashed
- fixed issue where plot_maps() could not plot wind data
- fixed issue where a style could not be updated when verb argument is specified
- new functions/methods on Fieldset to give an overview of contents: - fs.describe() - fs.describe("tp") - fs.ls() - see Jupyter notebook example at https://metview.readthedocs.io/en/latest/notebook_gallery.html
- new GRIB filtering function, select(), offers different filtering options from read() and is faster - see Jupyter notebook example at https://metview.readthedocs.io/en/latest/notebook_gallery.html
- new shorthand way to select parameters from Fieldsets, e.g. - g = fs["t"] - g = fs["t500"] - g = fs["t500hPa"]
- the Fieldset constructor can now take a list of paths to GRIB files or a wildcard: - e.g. a = mv.Fieldset(path=["/path1/to/data1.grib", "relpath/data2.grib"]) - e.g. a = mv.Fieldset(path="data/*.grib")
- the result of a call to mcont() etc can now be modified, e.g. - c = mv.mcont() ; c["contour_line_colour"] = "green" ; mv.plot(data, c) - gv.update({"MAP_COASTLINE_land_SHADE_COLOUR": "green"}, sub="COASTlines")
- improved the output of print(Fieldset): - "Fieldset (6 fields)"
- new argument to setoutput(plot_widget=) - default True, set False to allow images to be saved into the notebook
- multi-page plots in Jupyter notebooks now contain the animation controls by default
- added automatic play and speed controls to animated plots in Jupyter notebooks
- added animate=True argument to plot() command for animated plots in Jupyter notebooks
- allowed cfgrib backend keyword arguments to be passed to Fieldset.to_dataset()
- Fieldset out-of-range indexing now raises an IndexError
- Fieldset merge() function now allows a single Fieldset as argument
- renamed function download_gallery_data() to metview.gallery.load_dataset()
- added new function download_gallery_data() to download Gallery example data files
- added write(filename) method for classes Fieldset, Geopoints, GeopointSet, Bufr and NetCDF
- added ability to construct a Fieldset from a list of Fieldsets: Fieldset([f1, f2, f3])
- added metzoom function (for the future)
- added keyword arguments to setoutput('jupyter') to control output size in notebooks
- added metview_python member to result of version_info() function
- temporarily removed tests that involve writing xarrays as GRIB
- added support for int numpy arrays as input to functions and methods
- added support for bitwise and (&), or (|) and not (~) operators on Fieldsets
- added div() function (already available via the '/' operator)
- added mod() function
- improved timeout message by mentioning how to increase the timeout
- fixed error when updating an mv.Request object
- added new Jupyter notebook for data analysis
- added new Jupyter notebook for computing and plotting ensemble data
- fixed issue where Metview Request objects did not respect the input data type
- fixed issue when using a numpy array to index a Fieldset
- added travis ci and coveralls support
- added automatic upload to PyPi
- allow a geopoints column name to be used as index when assigning data to a column
- allow -, + and abs operators to work on Metview classes (e.g. a = -my_fieldset)
- added support for Metview's file object
- fixed issue where negative indexing did not work on a Fieldset
- fixed issue where concurrent iterators on a Fieldset did not work
- added experimental support for pickling Fieldsets
- automatically obtain list of Macro-based functions
- allow example notebooks to run in Binder
- fixed issue when passing sliced numpy arrays to Metview
- added environment.yaml for running in Binder
- fixed issue when running example notebooks in Binder
- fixed memory leak in Fieldset.append() method
- added support for reflected operators on Fieldsets, e.g. "2 * Fieldset" - done for addition, subtraction, multiplication, division and power
- added ml_to_hl() function
- export the Request class
- fixed memory leak when returning a list of items
- allow bool-typed numpy arrays as input
- fixed issue where the Fieldset iterator could fail if used multiple times
- Metview startup timeout configurable via environment variable METVIEW_PYTHON_START_TIMEOUT (in seconds)
- Metview startup timeout default set to 8 seconds in case of busy systems
- added integral() function
- fixed memory leak when exporting vectors as numpy arrays
- added equality (
==
) and non-equality (!=
) operators for Fieldset and Geopoints objects, e.g.same = (a == b)
will produce a new Fieldset with 1s where the values are the same, and 0s elsewhere. - added new thermodynamic, gradient and utility functions: 'thermo_data_info', 'thermo_parcel_path', 'thermo_parcel_area', 'xy_curve', 'potential_temperature', 'temperature_from_potential_temperature', 'saturation_mixing_ratio', 'mixing_ratio', 'vapour_pressure', 'saturation_vapour_pressure', 'lifted_condensation_level', 'divergence', 'vorticity', 'laplacian', 'geostrophic_wind_pl', 'geostrophic_wind_ml'
- improved conversion from geopoints to pandas dataframe to cope with new NCOLS subformat
- make conversion from Fieldset to xarray dataset compatible with latest versions of cfgrib
- code cleanup so that tox and pyflakes pass the tests
- fixed issue where creating
Fieldset
slices of more than 10 fields or so did not work - allow the creation of a
Fieldset
object, either emptyFieldsest()
or with a path to GRIBFieldset('/path/to/grib')
- added
append()
method to aFieldset
to append ``Fieldset``s to ``Fieldset``s - the
dataset_to_fieldset
function that converts an xarray dataset to a MetviewFieldset
now accepts theno_warn=True
argument to suppress warnings while the xarray GRIB writer is pre-beta - ignore errors on exit from a data examiner
- added more example Jupyter notebooks
- Beta release.