celldega 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pyproject.toml DELETED
@@ -1,31 +0,0 @@
1
- [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
4
-
5
- [project]
6
- name = "celldega"
7
- version = "0.1.3"
8
- dependencies = ["anywidget"]
9
- readme = "README.md"
10
-
11
- [project.optional-dependencies]
12
- dev = ["watchfiles", "jupyterlab"]
13
-
14
- # automatically add the dev feature to the default env (e.g., hatch shell)
15
- [tool.hatch.envs.default]
16
- features = ["dev"]
17
-
18
-
19
- [tool.hatch.build]
20
- only-packages = true
21
- artifacts = ["src/celldega/static/*"]
22
-
23
- [tool.hatch.build.hooks.jupyter-builder]
24
- build-function = "hatch_jupyter_builder.npm_builder"
25
- ensured-targets = ["src/celldega/static/widget.js"]
26
- skip-if-exists = ["src/celldega/static/widget.js"]
27
- dependencies = ["hatch-jupyter-builder>=0.5.0"]
28
-
29
- [tool.hatch.build.hooks.jupyter-builder.build-kwargs]
30
- npm = "npm"
31
- build_cmd = "build"
@@ -1,25 +0,0 @@
1
- import importlib.metadata
2
- import pathlib
3
-
4
- import anywidget
5
- import traitlets
6
- from traitlets import Unicode, Int, Float
7
-
8
- try:
9
- __version__ = importlib.metadata.version("celldega")
10
- except importlib.metadata.PackageNotFoundError:
11
- __version__ = "unknown"
12
-
13
-
14
- class Counter(anywidget.AnyWidget):
15
- _esm = pathlib.Path(__file__).parent / "static" / "widget.js"
16
- _css = pathlib.Path(__file__).parent / "static" / "widget.css"
17
- # value = traitlets.Int(0).tag(sync=True)
18
-
19
- ini_x = Float(4500).tag(sync=True)
20
- ini_y = Float(3200).tag(sync=True)
21
- ini_zoom = Float(0).tag(sync=True)
22
- max_image_zoom = Int(16).tag(sync=True)
23
- bounce_time = Int(200).tag(sync=True)
24
- token_traitlet = Unicode('token').tag(sync=True)
25
- base_url = Unicode('').tag(sync=True)
package/wasm-plugin.mjs DELETED
@@ -1,39 +0,0 @@
1
- // wasm-plugin.js
2
- import * as esbuild from 'esbuild';
3
- import path from 'node:path';
4
- import fs from 'node:fs';
5
-
6
- let wasmPlugin = {
7
- name: 'wasm',
8
- setup(build) {
9
- build.onResolve({ filter: /\.wasm$/ }, args => {
10
- if (args.namespace === 'wasm-stub') {
11
- return {
12
- path: args.path,
13
- namespace: 'wasm-binary',
14
- };
15
- }
16
- if (args.resolveDir === '') {
17
- return; // Ignore unresolvable paths
18
- }
19
- return {
20
- path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),
21
- namespace: 'wasm-stub',
22
- };
23
- });
24
-
25
- build.onLoad({ filter: /.*/, namespace: 'wasm-stub' }, async (args) => ({
26
- contents: `import wasm from ${JSON.stringify(args.path)}
27
- export default (imports) =>
28
- WebAssembly.instantiate(wasm, imports).then(
29
- result => result.instance.exports)`,
30
- }));
31
-
32
- build.onLoad({ filter: /.*/, namespace: 'wasm-binary' }, async (args) => ({
33
- contents: await fs.promises.readFile(args.path),
34
- loader: 'binary',
35
- }));
36
- },
37
- };
38
-
39
- export default wasmPlugin;