From a9eadda687cf58a8ee3832800672ebed29ba79a8 Mon Sep 17 00:00:00 2001 From: betolink Date: Sun, 22 Oct 2023 10:20:17 -0500 Subject: [PATCH] preparing for new release --- environment-dev.yml | 18 ++++++++++++++ .../ITS_LIVE_plot_profile_timeseries.ipynb | 18 +++++++++++--- notebooks/voila/itslive-widget.ipynb | 24 +++++++++++++++++-- notebooks/voila/velocity_widget.py | 13 ++++++++++ pyproject.toml | 2 +- 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/environment-dev.yml b/environment-dev.yml index 732685d..3b861df 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -3,9 +3,27 @@ channels: - conda-forge dependencies: - python=3.9.* + - jupyterlab - mamba - cartopy + - fiona + - geopandas + - ipyleaflet + - matplotlib-base + - pyproj + - ipympl + - pandas + - numpy + - s3fs + - sidecar + - shapely + - xarray + - markdown + - voila + - zarr - pip - pip: + - git+https://github.com/nasa-jpl/itslive-py.git + - utm - pynvim - "poetry>=1.2" diff --git a/notebooks/ITS_LIVE_plot_profile_timeseries.ipynb b/notebooks/ITS_LIVE_plot_profile_timeseries.ipynb index 2f46a00..ea08f25 100644 --- a/notebooks/ITS_LIVE_plot_profile_timeseries.ipynb +++ b/notebooks/ITS_LIVE_plot_profile_timeseries.ipynb @@ -32,12 +32,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "98368f4f-42cc-4dcb-94ce-388f482de2e0", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'itslive'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[1], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmatplotlib\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124minline\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mitslive\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mpyproj\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Transformer\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mutm\u001b[39;00m\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'itslive'" + ] + } + ], "source": [ "%matplotlib inline\n", "\n", @@ -202,7 +214,7 @@ "use_logscale = False\n", "\n", "# year_min = 1985.0\n", - "year_min = 2013.0\n", + "year_min = 1985.0\n", "year_max = 2023.1\n", "\n", "speed_min = 0\n", diff --git a/notebooks/voila/itslive-widget.ipynb b/notebooks/voila/itslive-widget.ipynb index e25157e..701d616 100644 --- a/notebooks/voila/itslive-widget.ipynb +++ b/notebooks/voila/itslive-widget.ipynb @@ -18,7 +18,8 @@ "\n", "matplotlib.rcParams['figure.figsize'] = [8, 4]\n", "matplotlib.rcParams[\"figure.autolayout\"] = True\n", - "matplotlib.pyplot.style.use('ggplot')\n", + "\n", + "matplotlib.pyplot.style.use('fast')\n", "\n", "velocity_widget = ITSLIVE()" ] @@ -59,7 +60,26 @@ "id": "9595c701-f37b-45dc-868f-069483ce5b3f", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# import numpy as np\n", + "\n", + "# import matplotlib.pyplot as plt\n", + "# import matplotlib.dates as pldates\n", + "\n", + "\n", + "# ax = velocity_widget.fig.axes[0]\n", + "\n", + "# # start, end = ax.get_xlim\n", + "\n", + "# loc = pldates.YearLocator() # this locator puts ticks at regular intervals\n", + "# ax.xaxis.set_major_locator(loc)\n", + "\n", + "# years = ax.get_xticklabels()\n", + "# for item in (years ):\n", + "# item.set_fontsize(7)\n", + "# ax.legend(fontsize=8)\n", + "# # ax.xaxis.set_major_formatter(ticker.FormatStrFormatter(''))\n" + ] } ], "metadata": { diff --git a/notebooks/voila/velocity_widget.py b/notebooks/voila/velocity_widget.py index 8470233..0bf8acc 100644 --- a/notebooks/voila/velocity_widget.py +++ b/notebooks/voila/velocity_widget.py @@ -11,6 +11,8 @@ import markdown import numpy as np import pandas as pd +import matplotlib.dates as pldates + # to get and use geojson datacube catalog # for datacube xarray/zarr access from IPython.display import display @@ -983,6 +985,17 @@ def plot_time_series(self, *args, **kwargs): self.fig.canvas.draw() self.fig_h.tight_layout() self.fig_h.canvas.draw() + self.ax.grid(axis='x') + # start, end = ax.get_xlim + + loc = pldates.YearLocator() # this locator puts ticks at regular intervals + self.ax.xaxis.set_major_locator(loc) + + years = self.ax.get_xticklabels() + for item in years: + item.set_fontsize(7) + self.ax.legend(fontsize=8) + self.ax.set_xlabel("Year") self._control_plot_button.disabled = False else: diff --git a/pyproject.toml b/pyproject.toml index f8069fb..73055b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "itslive" homepage = "https://github.com/nasa-jpl/itslive-vortex" -version = "0.2.0" +version = "0.3.0" description = "Python client for ITSLIVE gralcier velocity data" authors = ["Luis Lopez "] license = "GNUL V3"