Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install:
- cmd: endlocal
- cmd: 'SET PYTHONWARNINGS=ignore:mode:DeprecationWarning:docutils.io:245'
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (SET GIT_BRANCH=%APPVEYOR_REPO_BRANCH%)"
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/%APPVEYOR_REPO_BRANCH%)"
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/%APPVEYOR_REPO_BRANCH:/=-%)"

build: off

Expand All @@ -37,7 +37,7 @@ test_script:
deploy_script:
- cmd: "
IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (
deploy-conda-recipe -l %APPVEYOR_REPO_BRANCH% -py %PYTHON_VERSION% ci/conda-recipe
deploy-conda-recipe -l %APPVEYOR_REPO_BRANCH:/=-% -py %PYTHON_VERSION% ci/conda-recipe
) ELSE (
deploy-conda-recipe -py %PYTHON_VERSION% ci/conda-recipe
)"
10 changes: 7 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
psyplot: psyplot/psyplot-ci-orb@1.5.24
psyplot: psyplot/psyplot-ci-orb@1.5.29
mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0

executors:
Expand All @@ -25,6 +25,10 @@ parameters:
description: Build the documentation
type: boolean
default: true
python_version:
description: The python version to build
type: string
default: "3.8"

workflows:
build-and-test:
Expand All @@ -36,8 +40,8 @@ workflows:
setup_env: << pipeline.parameters.run-tests >>
build_args: "--no-test"
build_docs: << pipeline.parameters.build_docs >>
# HACK: force netcdf4 and hdf5 version to resolve dependency issue
env_packages: dask netcdf4 scipy netcdf4=1.5.7 h5py=3.4.0 hdf5=1.12.1
python_version: << pipeline.parameters.python_version >>
env_packages: dask netcdf4 scipy
- psyplot/test-parallel:
name: test-xarray-latest
parallelism: 2
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
v1.4.1
======
Compatibility fixes and minor improvements

Added
-----
- An abstract ``convert_coordinate`` method has been implemented for the
``Plotter`` and ``Formatoption`` class that can be used in subclasses to
convert coordinates for the required visualization. The default
implementation does nothing (see
`#39 <https://github.com/psyplot/psyplot/pull/39>`__)

Fixed
-----
- the update method now only takes the coordinates that are dimensions in the
dataset see `#39 <https://github.com/psyplot/psyplot/pull/39>`__
- psyplot is now compatible with matplotlib 3.5 and python 3.10

Changed
-------
- loading more than one variables into a ``DataArray`` now first selects the
corresponding dimensions, then puts it into a single ``DataArray``. This
avoids loading the entire data (see
`#39 <https://github.com/psyplot/psyplot/pull/39>`__)


v1.4.0
======
Compatibility fixes and LGPL license
Expand Down
7 changes: 1 addition & 6 deletions ci/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ test:
- netcdf4
- dask
- scipy
# HACK: solve inconsistensies with libwebp
# this should be removed when
# https://github.com/conda-forge/libwebp-feedstock/issues/26
# is solved
- libtiff <4.1.0 # [osx]
source_files:
- tests
commands:
Expand Down Expand Up @@ -71,5 +66,5 @@ about:
combines the plotting utilities of matplotlib and the data management of
the xarray package and integrates them into a software that can be used via
command-line and via a GUI.
doc_url: http://psyplot.github.io
doc_url: https://psyplot.github.io
dev_url: https://github.com/psyplot/psyplot
8 changes: 6 additions & 2 deletions docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ What it is
visualization. No GUI, independent of it's intuitiveness, can ever beat the
speed of a scientist that knows a bit of coding and how to use the different
formatoptions in psyplot.
- it visualizes :ref:`unstructured grids <psy_maps:gallery_examples_example_ugrid.ipynb>`,
such as ICON or UGRID model data
- it visualizes :ref:`unstructured grids <psyplot_examples:/maps/example_ugrid.ipynb>`,
such as ICON_ or UGRID_ model data
- it automatically decodes CF-conventions
- it intuitively integrates the structure of netCDF files. So if you often
work with netCDF files, psyplot might be a good option
Expand All @@ -93,6 +93,10 @@ What it is
plotting methods
- it will always be free and open-source under the LGPL License.

.. _ICON: https://mpimet.mpg.de/en/science/modeling-with-icon/icon-configurations
.. _UGRID: https://ugrid-conventions.github.io/ugrid-conventions/


What it is not
**************
No software can do everything, neither can psyplot. Our main focus on
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
'ignore', message='Using an implicitly registered datetime converter')
warnings.filterwarnings(
'ignore', message=r"\s*The on_mappable_changed function")
warnings.filterwarnings(
'ignore', message=r".+multi-part geometries is deprecated")
warnings.filterwarnings(
'ignore', message=r"\s*The array interface is deprecated")

# -- General configuration ------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: psyplot_docs
channels:
- local
- psyplot/label/develop
- psyplot/label/master
- conda-forge
dependencies:
Expand Down
37 changes: 26 additions & 11 deletions psyplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,39 @@ def get_versions(requirements=True, key=None):
}
}
"""
from pkg_resources import iter_entry_points
from importlib.metadata import entry_points
ret = {'psyplot': _get_versions(requirements)}
for ep in iter_entry_points(group='psyplot', name='plugin'):

try:
eps = entry_points(group='psyplot', name='plugin')
except TypeError: # python<3.10
eps = [ep for ep in entry_points().get('psyplot', [])
if ep.name == 'plugin']
for ep in eps:
if str(ep) in rcParams._plugins:
logger.debug('Loading entrypoint %s', ep)
if key is not None and not key(ep.module_name):

try:
ep.module
except AttributeError: # python<3.10
ep.module = ep.pattern.match(ep.value).group("module")

if key is not None and not key(ep.module):
continue
try:
mod = ep.load()
except (ImportError, ModuleNotFoundError) as e:
logger.debug("Could not import %s" % ep, exc_info=True)
logger.warning("Could not import %s" % ep)
try:
ret[str(ep.module_name)] = mod.get_versions(requirements)
except AttributeError:
ret[str(ep.module_name)] = {
'version': getattr(mod, 'plugin_version',
getattr(mod, '__version__', ''))}
logger.debug("Could not import %s" % (ep, ), exc_info=True)
logger.warning("Could not import %s" % (ep, ), exc_info=True)
else:
try:
ret[str(ep.module)] = mod.get_versions(requirements)
except AttributeError:
ret[str(ep.module)] = {
'version': getattr(
mod, 'plugin_version',
getattr(mod, '__version__', ''))
}
if key is None:
try:
import psyplot_gui
Expand Down
2 changes: 1 addition & 1 deletion psyplot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main(args=None):
The parser that has been used from the command line"""
try:
from psyplot_gui import get_parser as _get_parser
except ImportError:
except (ImportError, ModuleNotFoundError) as e:
logger.debug('Failed to import gui', exc_info=True)
parser = get_parser(create=False)
parser.update_arg('output', required=True)
Expand Down
31 changes: 21 additions & 10 deletions psyplot/config/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def __init__(self, *args, **kwargs):

Other Parameters
----------------
``*args, **kwargs``
*args, **kwargs
Any key-value pair for the initialization of the dictionary
"""
defaultParams = kwargs.pop('defaultParams', None)
Expand Down Expand Up @@ -755,16 +755,22 @@ def _load_plugin_entrypoints(self):

Yields
------
pkg_resources.EntryPoint
importlib.metadata.EntryPoint
The entry point for the psyplot plugin module"""
from pkg_resources import iter_entry_points
from importlib.metadata import entry_points

def load_plugin(ep):

try:
ep.module
except AttributeError: # python<3.10
ep.module = ep.pattern.match(ep.value).group("module")

if plugins_env == ['no']:
return False
elif ep.module_name in exclude_plugins:
elif ep.module in exclude_plugins:
return False
elif include_plugins and ep.module_name not in include_plugins:
elif include_plugins and ep.module not in include_plugins:
return False
return True

Expand All @@ -776,7 +782,12 @@ def load_plugin(ep):

logger = logging.getLogger(__name__)

for ep in iter_entry_points(group='psyplot', name='plugin'):
try:
eps = entry_points(group='psyplot', name='plugin')
except TypeError: # python<3.10
eps = [ep for ep in entry_points().get('psyplot', [])
if ep.name == 'plugin']
for ep in eps:
if not load_plugin(ep):
logger.debug('Skipping entrypoint %s', ep)
continue
Expand Down Expand Up @@ -811,7 +822,7 @@ def load_plugins(self, raise_error=False):
def_keys = {'default': defaultParams}

def register_pm(ep, name):
full_name = '%s:%s' % (ep.module_name, name)
full_name = '%s:%s' % (ep.module, name)
ret = True
if pm_env == ['no']:
ret = False
Expand All @@ -828,8 +839,8 @@ def register_pm(ep, name):
try:
plugin_mod = ep.load()
except (ModuleNotFoundError, ImportError):
logger.debug("Failed to import %s!" % ep, exc_info=True)
logger.warning("Failed to import %s!" % ep)
logger.debug("Failed to import %s!" % (ep, ), exc_info=True)
logger.warning("Failed to import %s!" % (ep, ))
continue
rc = plugin_mod.rcParams

Expand All @@ -852,7 +863,7 @@ def register_pm(ep, name):
else:
warn(msg)
for d in plugin_plotters.values():
d['plugin'] = ep.module_name
d['plugin'] = ep.module
plotters.update(plugin_plotters)
def_plots[ep] = list(plugin_plotters)

Expand Down
Loading