Skip to content

Update xtensor-zarr=0.0.7#43

Merged
joshmoore merged 3 commits into
zarr-developers:masterfrom
davidbrochart:update_xtensor
Jun 17, 2021
Merged

Update xtensor-zarr=0.0.7#43
joshmoore merged 3 commits into
zarr-developers:masterfrom
davidbrochart:update_xtensor

Conversation

@davidbrochart

Copy link
Copy Markdown
Contributor

No description provided.

@davidbrochart

Copy link
Copy Markdown
Contributor Author

Trigger CI

@davidbrochart davidbrochart reopened this May 1, 2021
@davidbrochart

Copy link
Copy Markdown
Contributor Author

The error is related to zarr.js:

(node:3417) ExperimentalWarning: The ESM module loader is experimental.
file:///home/runner/work/zarr_implementations/zarr_implementations/generate_data/js/src/index.js:3
import { PNG } from "pngjs";
         ^^^
SyntaxError: The requested module 'pngjs' does not provide an export named 'PNG'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
    at async Loader.import (internal/modules/esm/loader.js:179:24)

Maybe @manzt has some ideas?

@manzt

manzt commented May 1, 2021

Copy link
Copy Markdown
Member

Looks like a node version? No sure when/where that changed. The experimental warning is like from node pre-14. Ideally it should be node v15.

I can take a closer look later today.

@davidbrochart

Copy link
Copy Markdown
Contributor Author

Thanks, maybe adding the gdal dependency is responsible for downgrading node.

@manzt

manzt commented May 1, 2021

Copy link
Copy Markdown
Member

Can reproduce locally with node v12.

$ fnm use 12 # change node version
Using Node v12.19.1

$ npm start

> @ start /Users/fm813/github/manzt/zarr_implementations/generate_data/js
> node src/index.js

(node:43251) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/fm813/github/manzt/zarr_implementations/generate_data/js/src/index.js:3
import { PNG } from "pngjs";
         ^^^
SyntaxError: The requested module 'pngjs' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'pngjs';
const { PNG } = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:97:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:143:20)
    at async Loader.import (internal/modules/esm/loader.js:182:24)
    at async Object.loadESM (internal/process/esm_loader.js:84:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `node src/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fm813/.npm/_logs/2021-05-01T13_02_24_462Z-debug.log

on 15,

$ fnm use 15
Using Node v15.6.0

$ npm start

> start
> node src/index.js # no errors

@davidbrochart

Copy link
Copy Markdown
Contributor Author

@manzt I worked around the older version of npm, but I'm not sure if the changes would be acceptable to you.
Now the failures seem to be caused by the zarr-python implementation:

FAILED test/test_read_all.py::test_correct_read[read zarr (FSStore, nested) zarr using zarr, blosc]
FAILED test/test_read_all.py::test_correct_read[read zarr (FSStore, nested) zarr using zarr, gzip]
FAILED test/test_read_all.py::test_correct_read[read zarr (FSStore, nested) zarr using zarr, raw]
FAILED test/test_read_all.py::test_correct_read[read zarr (FSStore, nested) zarr using zarr, zlib]

@manzt

manzt commented May 1, 2021

Copy link
Copy Markdown
Member

@davidbrochart, this has to deal with how modules written for a legacy module system (common-js) are loaded in Node & browser as more modern ES modules. ESM is experimental in Node 12, but the changes you've made are supported in 12 and later. Totally acceptable – thanks!

@davidbrochart

Copy link
Copy Markdown
Contributor Author

Thank you @manzt.
@grlee77 any idea why zarr-python tests are failing?

@joshmoore

Copy link
Copy Markdown
Member

I'd suspect due to zarr-developers/zarr-python#729

@grlee77

grlee77 commented May 3, 2021

Copy link
Copy Markdown
Contributor

I'd suspect due to zarr-developers/zarr-python#729

agreed. it should be fixed again after zarr-developers/zarr-python#709 is finished

@grlee77

grlee77 commented Jun 16, 2021

Copy link
Copy Markdown
Contributor

This branch works locally with zarr 2.8.3 if you want to bump environment.yml to use that version here.

Comment thread environment.yml Outdated
- make
- cmake
- xtensor-zarr=0.0.4
- xtensor-zarr=0.0.7=*_1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this also be >=? Otherwise, 🎉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to >=0.0.8|=0.0.7=*_1.

@grlee77 grlee77 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to me (trusting @manzt's review of the JS changes)

@joshmoore joshmoore merged commit b09c57c into zarr-developers:master Jun 17, 2021
@davidbrochart davidbrochart deleted the update_xtensor branch June 17, 2021 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants