Skip to content

Commit f2f31e2

Browse files
committed
Fix time difference recognition for time-descending data sets. Fix zfpy being a widget dependency despite never being used (fix Numpy 2 issues). Set ipywidgets to 7.7.1 to fix Google Colab. Bump to 0.4.17.
1 parent 16c9964 commit f2f31e2

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

lexcube/_frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"""
2323

2424
module_name = "lexcube"
25-
module_version = "^0.4.16"
25+
module_version = "^0.4.17"

lexcube/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# You should have received a copy of the GNU General Public License
1818
# along with this program. If not, see <https://www.gnu.org/licenses/>.
1919

20-
__version__ = "0.4.16"
20+
__version__ = "0.4.17"

lexcube/lexcube_server/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ celerybeat.pid
106106

107107
# Environments
108108
.env
109-
.venv
109+
.venv*
110110
env/
111111
venv/
112112
ENV/
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
s3fs==2023.12.2
2-
bottleneck==1.3.7
2+
bottleneck==1.4.0
33
cachey==0.2.1
44
dask==2024.1.1
55
netCDF4==1.6.5
6-
opencv-python-headless==4.8.1.78
6+
numpy<2.0.0
7+
opencv-python-headless==4.10.0.84
78
psutil==5.9.6
89
xarray==2023.10.1
9-
zarr==2.16.1
10-
zfpy==1.0.0
10+
zarr==2.16.1

lexcube/lexcube_server/src/tile_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import numpy as np
4141
import psutil
4242
import xarray as xr
43-
import zfpy
4443
from dask.cache import Cache
4544
from typing import Union
4645

@@ -999,9 +998,11 @@ def __init__(self) -> None:
999998
self.precision = -1
1000999

10011000
def encode(self, data):
1001+
import zfpy
10021002
return zfpy.compress_numpy(data, self.tolerance, self.rate, self.precision)
10031003

10041004
def decode(self, data):
1005+
import zfpy
10051006
return zfpy.decompress_numpy(data)
10061007

10071008
class TileServer:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lexcube",
3-
"version": "0.4.16",
3+
"version": "0.4.17",
44
"description": "Lexcube: 3D Data Cube Visualization in Jupyter Notebooks",
55
"keywords": [
66
"jupyter",

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@ classifiers = [
3535
]
3636
dependencies = [
3737
"aiohttp>=3.7.4",
38-
"ipywidgets>=7.0.0",
38+
"ipywidgets==7.7.1",
3939
"bottleneck>=1.3.7",
4040
"cachey>=0.2.1",
4141
"dask>=2022.12.0",
4242
"netCDF4>=1.6.3",
4343
"opencv-python-headless>=4.7.0.72",
4444
"xarray>=v2022.12.0",
4545
"zarr>=2.14.2",
46-
"zfpy>=1.0.0",
4746
]
48-
version = "0.4.16"
47+
version = "0.4.17"
4948

5049
[project.optional-dependencies]
5150
docs = [
@@ -109,7 +108,7 @@ build_cmd = "build:prod"
109108
github_url = "https://github.com/msoechting/lexcube/"
110109

111110
[tool.tbump.version]
112-
current = "0.4.16"
111+
current = "0.4.17"
113112

114113
# Example of a semver regexp.
115114
# Make sure this matches current_version before

src/lexcube-client/src/client/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ const DEFAULT_WIDGET_HEIGHT = 768;
7878
const API_VERSION = 5;
7979
const TILE_VERSION = 2;
8080

81-
const PACKAGE_VERSION = "0.4.16";
81+
const PACKAGE_VERSION = "0.4.17";
8282

8383
export { DeviceOrientation, PACKAGE_VERSION, positiveModulo, range, getIndexDimensionOfFace, getAddressedFacesOfDimension, getFacesOfIndexDimension, capitalizeString, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT, DEFAULT_COLORMAP, ANOMALY_PARAMETER_ID_SUFFIX, TILE_FORMAT_MAGIC_BYTES, TILE_VERSION, TILE_SIZE, MAX_ZOOM_FACTOR, NAN_TILE_MAGIC_NUMBER, LOSSLESS_TILE_MAGIC_NUMBER, NAN_REPLACEMENT_VALUE, COLORMAP_STEPS, NOT_LOADED_REPLACEMENT_VALUE, API_VERSION, Dimension, CubeFace }

src/lexcube-client/src/client/interaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class CubeDimension {
160160
// }
161161
const indexLabel = this.indices[roundedIndex];
162162
if (this.type == CubeDimensionType.Time) {
163-
const totalTimeSpanDays = ((this.indices[this.indices.length - 1] as Date).getTime() - (this.indices[0] as Date).getTime()) / (1000 * 60 * 60 * 24);
164-
const secondsPerStep = ((this.indices[1] as Date).getTime() - (this.indices[0] as Date).getTime()) / (1000);
163+
const totalTimeSpanDays = Math.abs(((this.indices[this.indices.length - 1] as Date).getTime() - (this.indices[0] as Date).getTime()) / (1000 * 60 * 60 * 24));
164+
const secondsPerStep = Math.abs(((this.indices[1] as Date).getTime() - (this.indices[0] as Date).getTime()) / 1000);
165165
const daysPerStep = secondsPerStep / (60 * 60 * 24);
166166
const millisecondsRelevant = secondsPerStep < 1;
167167
return `${totalTimeSpanDays > 1 ? getDayString(indexLabel as Date) : ""} ${daysPerStep < 1 ? getTimeString(indexLabel as Date, millisecondsRelevant) : ""}`.trim();

tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# github_url = "https://github.com/<user or organization>/<project>/"
33

44
[version]
5-
current = "0.4.16"
5+
current = "0.4.17"
66

77
# Example of a semver regexp.
88
# Make sure this matches current_version before

0 commit comments

Comments
 (0)