Giter VIP home page Giter VIP logo

earthkit-maps's People

Contributors

jamesvarndell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

earthkit-maps's Issues

Make cf-units a dependency

What happened?

When I try to visualise a grib file containing 2t with quickplot:

earthkit.maps.quickplot(ds)

it fails with:

ImportError: cf-units is required for checking unit equivalence

What are the steps to reproduce the bug?

See above

Version

develop

Platform (OS and architecture)

all

Relevant log output

No response

Accompanying data

No response

Organisation

No response

Cannot import when installed from pypi because cv2 is missing

What happened?

When I install earthkit-maps from pypi with pip install earthkit-maps I cannot import it because cv2 is not found:

import earthkit.maps

...

E   ModuleNotFoundError: No module named 'cv2'

What are the steps to reproduce the bug?

See above

Version

0.0.1

Platform (OS and architecture)

macOS

Relevant log output

No response

Accompanying data

No response

Organisation

No response

Cannot import when installed from pypi because domains not found

What happened?

When I install earthkit-maps from pypi with pip install earthkit-maps I cannot import it because :

import earthkit.maps

raises:

earthkit/maps/data.py", line 54, in load
    raise DataNotFoundError(f"could not find data named '{source}'")
earthkit.maps.data.DataNotFoundError: could not find data named 'domains'

What are the steps to reproduce the bug?

See above

Version

0.0.5

Platform (OS and architecture)

all

Relevant log output

No response

Accompanying data

No response

Organisation

ECMWF

Use ECMWF's downstream-ci in GitHub Actions

What maintenance does this project need?

To make earthkit-maps' ci work in the same way as other ECMWF packages, the following should be done:

  • add to downstream-ci as per instructions here
  • dependencies in the tree for now should be earthkit-data
  • any ci actions that are special to this package should be in a separate yml file
  • revise the cd action as per instructions here

Note: this cannot be done until the same is done for earthkit-data (ecmwf/earthkit-data#259).

Thank you!

Organisation

ECMWF

Add style source selection to schema

Is your feature request related to a problem? Please describe.

earthkit-maps is targetting a wide range of users, including:

  • researchers, who are likely to want to visualise datasets in their native units
  • forecasters, who want to automatically see data in the most appropriate units for forecasting

Describe the solution you'd like

earthkit-maps should have multiple sources for styles, which can be selected with a switch in the schema. There should also possibly be a switch like "automatically_convert_units", allowing users to switch on/off automatic unit conversion.

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

Reasoning for style structure?

Is your feature request related to a problem? Please describe.

When specifying another style_library, all default styles are no longer active. I am curious as to why this is the case?

I would have expected the default to remain active and be overwritten by the chosen library if it has specified it.

E.g.
ecmwf specified temperature but does not specify mslp.
Should than the default still be used?

Describe the solution you'd like

I think that using default as the default to be overwritten may help.
I am prototyping a solution on my fork currently.

Describe alternatives you've considered

No response

Additional context

No response

Organisation

Australian Bureau of Meteorology

Misaligned legend when using quickplot for two fields

What happened?

If I use this code (develop branch):

import earthkit.data
from earthkit.maps.quickplot import quickplot

earthkit.data.download_example_file("test.grib")
data = earthkit.data.from_source("file", "test.grib")

quickplot(data)

I get this plot in a notebook:

image

What are the steps to reproduce the bug?

See above

Version

develop

Platform (OS and architecture)

macOS

Relevant log output

No response

Accompanying data

No response

Organisation

ECMWF

Add conversion between earthkit-maps styles and Magics styles

Is your feature request related to a problem? Please describe.

The Style class in earthkit-maps should have methods to convert to and from Magics styles.

Describe the solution you'd like

Two new methods should be added to earthkit.maps.Style:

style.to_magics_style()
Style.from_magics_style()  # classmethod

Describe alternatives you've considered

No response

Additional context

No response

Organisation

ECMWF

BOM Style tcwv

What happened?

Due to the recent changes, the tcwv style within the Bureau schema, is broken.
It prevents any loading of data otherwise not assigned a style.

It was originally intended to be an alias for precipitable water, but that functionality seems no longer available.

What are the steps to reproduce the bug?

With any data except those with a defined style, create a chart using the bom schema.

earthkit.maps.schema.use('bom')

Version

0.0.13

Platform (OS and architecture)

Linux

Relevant log output

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[22], line 3
      1 chart = earthkit.maps.Chart(domain = 'Oceania')
----> 2 chart.plot(ds['msl'].isel(time = 0))

File /earthkit-maps/earthkit/maps/charts/__init__.py:327, in Chart.plot(self, data, *args, **kwargs)
    323     raise NotImplementedError(
    324         "Plotting pandas DataFrames and Series is an upcoming feature"
    325     )
    326 else:
--> 327     return self._plot_gridded_scalar(data, *args, **kwargs)

File /earthkit-maps/earthkit/maps/charts/__init__.py:290, in Chart._expand_rows_cols.<locals>.wrapper(self, data, *args, **kwargs)
    288     else:
    289         subplot = self.subplots[i]
--> 290     layer = getattr(subplot, method.__name__)(field, *args, **kwargs)
    291     layers.append(layer)
    293 return LayerGroup(layers)

File /earthkit-maps/earthkit/maps/charts/subplots.py:149, in Subplot.plot_gridded_scalar.<locals>.wrapper(self, data, transform_first, style, *args, **kwargs)
    142 if transform_first is None:
    143     transform_first = self._can_transform_first(method)
    145 mappable = method(
    146     self,
    147     input_data.x,
    148     input_data.y,
--> 149     input_data.values,
    150     style=input_data.style,
    151     transform=input_data.transform,
    152     transform_first=transform_first,
    153     **kwargs,
    154 )
    156 layer = Layer(data, mappable, self, style=input_data.style)
    157 self.layers.append(layer)

File /earthkit-maps/earthkit/maps/inputs.py:100, in Input.values(self)
     98 @property
     99 def values(self):
--> 100     return self.style.convert_units(
    101         self._values,
    102         self.source_units,
    103         self.short_name,
    104     )

File /earthkit-maps/earthkit/maps/inputs.py:95, in Input.style(self)
     93     if not schema.use_preferred_styles:
     94         style_units = self._kwargs.pop("units", None) or self.source_units
---> 95     self._style = styles.auto.guess_style(self.data, units=style_units)
     96 return self._style

File /earthkit-maps/earthkit/maps/styles/auto.py:38, in guess_style(data, units)
     35 with open(fname, "r") as f:
     36     config = yaml.load(f, Loader=yaml.SafeLoader)
---> 38 for criteria in config["criteria"]:
     39     for key, value in criteria.items():
     40         if data.metadata(key, default=None) != value:

KeyError: 'criteria'


### Accompanying data

_No response_

### Organisation

Australian Bureau of Meteorology

Add possibility to specify a colour to use for NaN values when converting values to colors

Is your feature request related to a problem? Please describe.

At present, there is no way to specify a different colour to use for NaN values in earthkit.maps.styles.Style.values_to_colors. This should be added to allow more complex colour schemes to work with polygon plotting.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Organisation

No response

styles - Inclusion of other agencies

Currently the styles directory contains default and ecmwf styles, which implies the inclusion of other agency or standard styles.
What would therefore be the process of adding another agencies style into earthkit-maps?

Would it be

  • Add another folder directly into earthkit-maps
  • A plugin design, withearthkit-maps-AGENCY

I am wondering, as I have found this tool to be exceptionally useful, and as a part of another agency, we have our own styles which I am building on my fork. How would this be included for further use?

Implement default style

Is your feature request related to a problem? Please describe.

As discussed in #30, it would be beneficial to alter how styles are chosen.

Describe the solution you'd like

This implementation will use the default styles by default or use any overriden styles defined by the schema.

Describe alternatives you've considered

No response

Additional context

Issue #30, was closed in reference to another pull request which had no associated issue, #29. Instead #31 implements this feature.

Organisation

Australian Bureau of Meteorology

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.