Skip to content

Commit dec7039

Browse files
authored
Merge pull request #9 from koldunovn/add-time-series
add tests to timeseries
2 parents 0b380d2 + 3692ada commit dec7039

File tree

3 files changed

+673
-1
lines changed

3 files changed

+673
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ The test suite includes:
192192
- **test_colormaps**: Color mapping functions
193193
- **test_term_render_mode**: Terminal render mode parsing/cycling helpers
194194
- **test_range_popup**: Range popup logic (symmetric computation, value parsing)
195+
- **test_timeseries**: Time series reading, multi-file concatenation, and CF time unit conversion
195196
- **test_file_netcdf**: NetCDF file I/O
196197
- **test_file_zarr**: Zarr file I/O (when built with `WITH_ZARR=1`)
197198
- **test_integration**: End-to-end workflow tests
@@ -211,6 +212,12 @@ The test suite includes:
211212
- **Minimum/Maximum**: Editable text fields for exact values
212213
- **Symmetric about Zero**: Sets range to [-max(|min|,|max|), max(|min|,|max|)]
213214
- **Reset to Global Values**: Restores the variable's full data range
215+
- **Time series plot**: Click on the image to show a time series popup at that location:
216+
- Displays value vs time for the selected variable at the clicked grid point
217+
- Y-axis with numeric tick labels, X-axis with CF time date formatting (when detected)
218+
- Blue data line with dots at data points; gaps shown for fill/missing values
219+
- Works with both single files and multi-file datasets
220+
- When files have different time epochs, values are automatically normalized to a common reference
214221
- **Dimension panel**: Shows dimension names, ranges, current values
215222
- **Colorbar**: Min/max and intermediate labels update as you adjust range
216223

tests/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif
4747
SRCDIR = ../src
4848

4949
# Test executables
50-
TEST_TARGETS = test_kdtree test_mesh test_regrid test_colormaps test_file_netcdf test_integration test_term_render_mode test_range_popup
50+
TEST_TARGETS = test_kdtree test_mesh test_regrid test_colormaps test_file_netcdf test_integration test_term_render_mode test_range_popup test_timeseries
5151

5252
# Add zarr test if enabled
5353
ifdef WITH_ZARR
@@ -103,6 +103,9 @@ RANGE_UTILS_OBJ = $(SRCDIR)/interface/range_utils.c
103103
test_range_popup: test_range_popup.c $(RANGE_UTILS_OBJ)
104104
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
105105

106+
test_timeseries: test_timeseries.c $(FILE_NETCDF_OBJ) $(MESH_DEPS) $(KDTREE_OBJ)
107+
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
108+
106109
# Zarr test (only built with WITH_ZARR=1)
107110
test_file_zarr: test_file_zarr.c $(FILE_ZARR_OBJ) $(CJSON_OBJ) $(MESH_DEPS) $(KDTREE_OBJ)
108111
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
@@ -157,6 +160,9 @@ test-term-render-mode: test_term_render_mode
157160
test-range-popup: test_range_popup
158161
./test_range_popup
159162

163+
test-timeseries: test_timeseries
164+
./test_timeseries
165+
160166
test-zarr: test_file_zarr
161167
./test_file_zarr
162168

@@ -194,6 +200,7 @@ help:
194200
@echo " test-integration - Run Integration tests only"
195201
@echo " test-term-render-mode - Run terminal render mode tests only"
196202
@echo " test-range-popup - Run range popup logic tests only"
203+
@echo " test-timeseries - Run timeseries reading tests only"
197204
@echo " memcheck - Run valgrind memory check on all tests"
198205
@echo " clean - Remove test executables and temp files"
199206
@echo " help - Show this help message"

0 commit comments

Comments
 (0)