nps-cli 0.1.1__tar.gz → 0.1.2__tar.gz

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.
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nps-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A simple CLI for sampling point clouds from large volumetric datasets
5
5
  Author: Jakob Troidl
6
6
  License-Expression: MIT
7
- Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.11
8
8
  Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  Requires-Dist: click
@@ -17,7 +17,10 @@ Requires-Dist: build; extra == "dev"
17
17
  Requires-Dist: twine; extra == "dev"
18
18
  Requires-Dist: ruff; extra == "dev"
19
19
 
20
- # CLI for Point Cloud Sampling
20
+ [![pypi](https://badge.fury.io/py/nps-cli.svg)](https://badge.fury.io/py/nps-cli)
21
+ [![Python Version](https://img.shields.io/pypi/pyversions/nps-cli.svg)](https://pypi.org/project/nps-cli/)
22
+
23
+ # CLI for Distributed Point Cloud Sampling
21
24
 
22
25
  ```
23
26
  pip install nps-cli
@@ -34,7 +37,7 @@ Options:
34
37
  --timestamp INTEGER Optional timestamp for the dataset version
35
38
  (graphene only).
36
39
  --sample_svids Sample SVIDs in addition to points (default:
37
- False).
40
+ False) Graphene only.
38
41
  -o, --output-dir DIRECTORY Output directory. [default: ./nps_output]
39
42
  --worker-type [LocalWorker|LSFWorker|SlurmWorker]
40
43
  Type of worker to use for sampling.
@@ -46,6 +49,8 @@ Options:
46
49
  local]
47
50
  --fraction FLOAT Fraction of points to sample [0.0, 1.0].
48
51
  [default: 0.001]
52
+ --bbox INTEGER... Bounding box: begin_x begin_y begin_z
53
+ end_x end_y end_z (in voxels).
49
54
  --block-size INTEGER... Block size in voxels (X Y Z). [default:
50
55
  128, 128, 128]
51
56
  -h, --help Show this message and exit.
@@ -57,6 +62,12 @@ Options:
57
62
  nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation
58
63
  ```
59
64
 
65
+ Sample point clouds within a FlyEM Hemibrain subvolume:
66
+
67
+ ```bash
68
+ nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation --bbox 15347 19712 18606 15859 20224 19118 --fraction 0.01
69
+ ```
70
+
60
71
  ### Reading Point Clouds
61
72
 
62
73
  Please refer to the [pocaduck](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#querying-point-clouds) repo on how to read point clouds from the output directory:
@@ -80,3 +91,10 @@ query.close()
80
91
  ```
81
92
 
82
93
  For optimized point cloud reading, consider [this](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#running-the-optimization-pipeline).
94
+
95
+
96
+ ### Deploy
97
+ ```python
98
+ python -m build
99
+ twine upload dist/*
100
+ ```
@@ -1,4 +1,7 @@
1
- # CLI for Point Cloud Sampling
1
+ [![pypi](https://badge.fury.io/py/nps-cli.svg)](https://badge.fury.io/py/nps-cli)
2
+ [![Python Version](https://img.shields.io/pypi/pyversions/nps-cli.svg)](https://pypi.org/project/nps-cli/)
3
+
4
+ # CLI for Distributed Point Cloud Sampling
2
5
 
3
6
  ```
4
7
  pip install nps-cli
@@ -15,7 +18,7 @@ Options:
15
18
  --timestamp INTEGER Optional timestamp for the dataset version
16
19
  (graphene only).
17
20
  --sample_svids Sample SVIDs in addition to points (default:
18
- False).
21
+ False) Graphene only.
19
22
  -o, --output-dir DIRECTORY Output directory. [default: ./nps_output]
20
23
  --worker-type [LocalWorker|LSFWorker|SlurmWorker]
21
24
  Type of worker to use for sampling.
@@ -27,6 +30,8 @@ Options:
27
30
  local]
28
31
  --fraction FLOAT Fraction of points to sample [0.0, 1.0].
29
32
  [default: 0.001]
33
+ --bbox INTEGER... Bounding box: begin_x begin_y begin_z
34
+ end_x end_y end_z (in voxels).
30
35
  --block-size INTEGER... Block size in voxels (X Y Z). [default:
31
36
  128, 128, 128]
32
37
  -h, --help Show this message and exit.
@@ -38,6 +43,12 @@ Options:
38
43
  nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation
39
44
  ```
40
45
 
46
+ Sample point clouds within a FlyEM Hemibrain subvolume:
47
+
48
+ ```bash
49
+ nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation --bbox 15347 19712 18606 15859 20224 19118 --fraction 0.01
50
+ ```
51
+
41
52
  ### Reading Point Clouds
42
53
 
43
54
  Please refer to the [pocaduck](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#querying-point-clouds) repo on how to read point clouds from the output directory:
@@ -60,4 +71,11 @@ print(f"Retrieved {points.shape[0]} points for label 12345")
60
71
  query.close()
61
72
  ```
62
73
 
63
- For optimized point cloud reading, consider [this](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#running-the-optimization-pipeline).
74
+ For optimized point cloud reading, consider [this](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#running-the-optimization-pipeline).
75
+
76
+
77
+ ### Deploy
78
+ ```python
79
+ python -m build
80
+ twine upload dist/*
81
+ ```
@@ -19,7 +19,8 @@ from volara.workers import LSFWorker, LocalWorker, SlurmWorker
19
19
  @click.option('--queue', default='local', show_default=True, help='Queue name (for LSF backend).')
20
20
  @click.option('--fraction', default=0.001, show_default=True, type=float, help='Fraction of points to sample [0.0, 1.0].')
21
21
  @click.option('--block-size', nargs=3, type=int, default=(128, 128, 128), show_default=True, help='Block size in voxels (X Y Z).')
22
- def main(cv_path, mip, timestamp, output_dir, num_workers, cpus_per_worker, queue, fraction, block_size, sample_svids, worker_type):
22
+ @click.option('--bbox', nargs=6, type=int, default=None, help='Bounding box: begin_x begin_y begin_z end_x end_y end_z (in voxels).')
23
+ def main(cv_path, mip, timestamp, output_dir, num_workers, cpus_per_worker, queue, fraction, block_size, sample_svids, worker_type, bbox):
23
24
 
24
25
  click.echo(f"Reading CloudVolume at {cv_path} (mip={mip}, timestamp={timestamp})")
25
26
 
@@ -48,6 +49,13 @@ def main(cv_path, mip, timestamp, output_dir, num_workers, cpus_per_worker, queu
48
49
  click.echo(f"Using SlurmWorker with queue '{queue}' and {cpus_per_worker} CPUs per worker.")
49
50
  worker_config = SlurmWorker(queue=queue, num_cpus=cpus_per_worker)
50
51
 
52
+ roi = None
53
+ if bbox is not None:
54
+ begin = bbox[:3]
55
+ end = bbox[3:]
56
+ shape = tuple(e - b for b, e in zip(begin, end))
57
+ roi = (begin, shape)
58
+
51
59
  task = SamplePoints(
52
60
  labels=labels,
53
61
  svids=svids,
@@ -55,7 +63,8 @@ def main(cv_path, mip, timestamp, output_dir, num_workers, cpus_per_worker, queu
55
63
  num_workers=num_workers,
56
64
  out_dir=points_dir,
57
65
  fraction=fraction,
58
- worker_config=worker_config
66
+ worker_config=worker_config,
67
+ roi=roi,
59
68
  )
60
69
 
61
70
  click.echo("Running task...")
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nps-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A simple CLI for sampling point clouds from large volumetric datasets
5
5
  Author: Jakob Troidl
6
6
  License-Expression: MIT
7
- Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.11
8
8
  Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  Requires-Dist: click
@@ -17,7 +17,10 @@ Requires-Dist: build; extra == "dev"
17
17
  Requires-Dist: twine; extra == "dev"
18
18
  Requires-Dist: ruff; extra == "dev"
19
19
 
20
- # CLI for Point Cloud Sampling
20
+ [![pypi](https://badge.fury.io/py/nps-cli.svg)](https://badge.fury.io/py/nps-cli)
21
+ [![Python Version](https://img.shields.io/pypi/pyversions/nps-cli.svg)](https://pypi.org/project/nps-cli/)
22
+
23
+ # CLI for Distributed Point Cloud Sampling
21
24
 
22
25
  ```
23
26
  pip install nps-cli
@@ -34,7 +37,7 @@ Options:
34
37
  --timestamp INTEGER Optional timestamp for the dataset version
35
38
  (graphene only).
36
39
  --sample_svids Sample SVIDs in addition to points (default:
37
- False).
40
+ False) Graphene only.
38
41
  -o, --output-dir DIRECTORY Output directory. [default: ./nps_output]
39
42
  --worker-type [LocalWorker|LSFWorker|SlurmWorker]
40
43
  Type of worker to use for sampling.
@@ -46,6 +49,8 @@ Options:
46
49
  local]
47
50
  --fraction FLOAT Fraction of points to sample [0.0, 1.0].
48
51
  [default: 0.001]
52
+ --bbox INTEGER... Bounding box: begin_x begin_y begin_z
53
+ end_x end_y end_z (in voxels).
49
54
  --block-size INTEGER... Block size in voxels (X Y Z). [default:
50
55
  128, 128, 128]
51
56
  -h, --help Show this message and exit.
@@ -57,6 +62,12 @@ Options:
57
62
  nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation
58
63
  ```
59
64
 
65
+ Sample point clouds within a FlyEM Hemibrain subvolume:
66
+
67
+ ```bash
68
+ nps --cv-path precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.0/segmentation --bbox 15347 19712 18606 15859 20224 19118 --fraction 0.01
69
+ ```
70
+
60
71
  ### Reading Point Clouds
61
72
 
62
73
  Please refer to the [pocaduck](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#querying-point-clouds) repo on how to read point clouds from the output directory:
@@ -80,3 +91,10 @@ query.close()
80
91
  ```
81
92
 
82
93
  For optimized point cloud reading, consider [this](https://github.com/JaneliaSciComp/pocaduck?tab=readme-ov-file#running-the-optimization-pipeline).
94
+
95
+
96
+ ### Deploy
97
+ ```python
98
+ python -m build
99
+ twine upload dist/*
100
+ ```
@@ -1,7 +1,6 @@
1
1
  README.md
2
2
  pyproject.toml
3
3
  nps/__init__.py
4
- nps/config.py
5
4
  nps/main.py
6
5
  nps_cli.egg-info/PKG-INFO
7
6
  nps_cli.egg-info/SOURCES.txt
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nps-cli"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "A simple CLI for sampling point clouds from large volumetric datasets"
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  requires-python = ">=3.11"
@@ -17,7 +17,7 @@ dependencies = [
17
17
  ]
18
18
 
19
19
  classifiers = [
20
- "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.11",
21
21
  ]
22
22
 
23
23
  [project.optional-dependencies]
@@ -1,5 +0,0 @@
1
- import yaml
2
-
3
- def load_config(path):
4
- with open(path, 'r') as f:
5
- return yaml.safe_load(f)
File without changes
File without changes