Skip to content

Commit

Permalink
Merge pull request #375 from Carifio24/refresh-tile-cache
Browse files Browse the repository at this point in the history
Allow refreshing tile cache
  • Loading branch information
pkgw authored May 16, 2024
2 parents 2c7377b + e1c6431 commit 0f6d3f0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .readthedocs_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ dependencies:
- reproject
- setuptools
- sphinx
- sphinx-automodapi
# This pin is to work around a conda verification error
# that first appeared in the CI for https://github.com/WorldWideTelescope/pywwt/pull/375.
# At the time of writing this, the issue only occurs with sphinx-automodapi==0.17,
# which is the newest version.
- sphinx-automodapi=0.16
2 changes: 0 additions & 2 deletions ci/azure-job-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ steps:
set -euo pipefail
source activate-conda.sh
set -x
# workaround for the Windows CI image:
conda install -y brotlipy
conda config --add channels conda-forge
conda config --set channel_priority strict
conda update -y --all
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"dependencies": {
"@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6",
"@wwtelescope/research-app": "^0.16.0",
"@wwtelescope/research-app": "^0.17.0",
"underscore": "^1"
},
"description": "WorldWide Telescope from Python",
Expand Down
10 changes: 10 additions & 0 deletions pywwt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,3 +1372,13 @@ def _serialize_to_json(self, file, title, max_width, max_height):

def _save_added_data(self, dir):
self.layers._save_all_data_for_serialization(dir)

# Miscellaneous

def refresh_tile_cache(self):
"""
Clear the current cache of tiles.
Note that this should only be used when necessary, as any
previously downloaded tiles will need to be re-fetched.
"""
self._send_msg(event="clear_tile_cache")
3 changes: 2 additions & 1 deletion pywwt/tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pytest
from stat import S_IWGRP, S_IWOTH, S_IWUSR, S_IMODE
from tempfile import TemporaryDirectory
from warnings import catch_warnings

from . import assert_widget_image, wait_for_test, DATA
from ..conftest import RUNNING_ON_CI, QT_INSTALLED # noqa
Expand Down Expand Up @@ -285,7 +286,7 @@ def test_cartesian_layer(self):

# Make sure adding the layer doesn't emit any warnings, which previously
# happened due to a bug with the logic in the table layer initialization
with pytest.warns(None) as record:
with catch_warnings(record=True) as record:
layer = self.client.layers.add_table_layer(
table=table, coord_type="rectangular", x_att="x", y_att="y", z_att="z"
)
Expand Down
2 changes: 1 addition & 1 deletion pywwt/tests/test_qt_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ..conftest import RUNNING_ON_CI


WAIT_TIME = 5 if RUNNING_ON_CI else 1
WAIT_TIME = 10 if RUNNING_ON_CI else 1
M42 = SkyCoord.from_name('M42')


Expand Down

0 comments on commit 0f6d3f0

Please sign in to comment.