Skip to content

Commit b31bbfd

Browse files
committed
ready for review
1 parent 3c271b9 commit b31bbfd

5 files changed

Lines changed: 34 additions & 12 deletions

File tree

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Changes in 0.3.2
2+
3+
- Improved logging output when `visualize` is disabled in the configuration.
4+
- Updated dependency versions for the xcube data store plugins.
5+
6+
17
## Changes in 0.3.1
28

39
- Use `xcube_resampling.gridmapping.GridMapping.regular_from_bbox` to create a

environment.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ dependencies:
1313
- tabulate
1414
- xarray
1515
- xcube >=1.13.1
16-
- xcube-resampling >=0.3.1
16+
- xcube-resampling >=0.3.2
1717
- yaml
1818
# data store plugins
19-
- xcube-cci >=0.12.1
19+
- xcube-cci >=0.13
2020
- xcube-cds >=1.2.0
21-
- xcube-clms >=0.2.2
22-
- xcube-stac >=1.2.0
23-
- xcube-zenodo >=1.1.1
21+
- xcube-clms >=1.3.0
22+
- xcube-stac >=1.2.2
23+
- xcube-zenodo >=1.2.0
2424
# Development Dependencies - Tools
2525
- black
2626
- isort

test/test_multistore.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ def test_generate_no_visualization(self):
229229
msds.generate()
230230
self.assertIsInstance(msds, MultiSourceDataStore)
231231
self.assertEqual(4, len(cm.output))
232-
msg = "INFO:xcube.multistore:Dataset 'dataset1' finished:"
232+
msg = (
233+
"INFO:xcube.multistore:Data ID: dataset1; Status: COMPLETED; "
234+
"Message: Dataset 'dataset1' finished"
235+
)
233236
self.assertIn(msg, str(cm.output[-1]))
234237
ds = msds.stores.storage.open_data("dataset1.nc")
235238
self.assertIsInstance(ds, xr.Dataset)
@@ -299,7 +302,10 @@ def test_generate_preload(self):
299302
self.assertEqual(3, len(cm.output))
300303
msg = "INFO:xcube.multistore:Data ID 'andorra.zip' already preloaded."
301304
self.assertEqual(msg, str(cm.output[1]))
302-
msg = "INFO:xcube.multistore:Dataset 'senf_andorra' already generated."
305+
msg = (
306+
"INFO:xcube.multistore:Data ID: senf_andorra; Status: COMPLETED; "
307+
"Message: Dataset 'senf_andorra' already generated."
308+
)
303309
self.assertEqual(msg, str(cm.output[2]))
304310
ds = msds.stores.storage.open_data("senf_andorra.zarr")
305311
self.assertIsInstance(ds, xr.Dataset)
@@ -357,7 +363,7 @@ def test_generate_error_process_dataset(self):
357363
msds.generate()
358364
self.assertIsInstance(msds, MultiSourceDataStore)
359365
self.assertEqual(3, len(cm.output))
360-
self.assertIn("ERROR:xcube.multistore:An error occurred:", str(cm.output[-1]))
366+
self.assertIn("ERROR:xcube.multistore:Data ID: dataset1", str(cm.output[-1]))
361367
self.assertIn("KeyError: 'grid1'", str(cm.output[-1]))
362368

363369
def test_generate_error_write_dataset(self):
@@ -368,7 +374,7 @@ def test_generate_error_write_dataset(self):
368374
msds.generate()
369375
self.assertIsInstance(msds, MultiSourceDataStore)
370376
self.assertEqual(4, len(cm.output))
371-
self.assertIn("ERROR:xcube.multistore:An error occurred: ", str(cm.output[-1]))
377+
self.assertIn("ERROR:xcube.multistore:Data ID: dataset1", str(cm.output[-1]))
372378
self.assertIn(
373379
"AttributeError: 'ZenodoDataStore' object has no attribute 'write_data'",
374380
str(cm.output[-1]),

xcube_multistore/multistore.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,19 @@ def _notify(self, event: GeneratorState):
439439
self._display.update()
440440
else:
441441
if event.status == GeneratorStatus.failed:
442-
LOG.error("An error occurred: %s", event.exception)
442+
LOG.error(
443+
"Data ID: %s; Status: %s; Exception: %s",
444+
event.identifier,
445+
event.status,
446+
event.exception,
447+
)
443448
else:
444-
LOG.info(event.message)
449+
LOG.info(
450+
"Data ID: %s; Status: %s; Message: %s",
451+
event.identifier,
452+
event.status,
453+
event.message,
454+
)
445455

446456
def _notify_error(self, identifier: str, exception: Any):
447457
self._notify(

xcube_multistore/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22-
__version__ = "0.3.1"
22+
__version__ = "0.3.2"

0 commit comments

Comments
 (0)