Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DITB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DISCO Beamline
DITB
Commits
2d09dabf
Commit
2d09dabf
authored
7 months ago
by
Hugo chauvet
Browse files
Options
Downloads
Patches
Plain Diff
Try to improve the speed to display the CLI
parent
f55ee7e2
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
ditb/commands/convert.py
+5
-3
5 additions, 3 deletions
ditb/commands/convert.py
ditb/commands/darkwhite.py
+5
-4
5 additions, 4 deletions
ditb/commands/darkwhite.py
ditb/commands/stitch.py
+16
-13
16 additions, 13 deletions
ditb/commands/stitch.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
27 additions
and
21 deletions
ditb/commands/convert.py
+
5
−
3
View file @
2d09dabf
...
@@ -6,9 +6,6 @@ This file is part of DITB.
...
@@ -6,9 +6,6 @@ This file is part of DITB.
Contains the cli interface for the convert command
Contains the cli interface for the convert command
"""
"""
import
click
import
click
from
..io.converter
import
MM2Zarr
,
mmzarr2MMformat
from
pathlib
import
Path
import
shutil
@click.command
@click.command
@click.argument
(
'
source
'
,
nargs
=-
1
,
type
=
click
.
Path
(
exists
=
True
))
@click.argument
(
'
source
'
,
nargs
=-
1
,
type
=
click
.
Path
(
exists
=
True
))
...
@@ -23,6 +20,11 @@ def convert(convertor, source, destination, force):
...
@@ -23,6 +20,11 @@ def convert(convertor, source, destination, force):
📦 Convert data to several format.
📦 Convert data to several format.
"""
"""
# Do the import in the function to improve cli speed
from
..io.converter
import
MM2Zarr
,
mmzarr2MMformat
from
pathlib
import
Path
import
shutil
if
convertor
in
[
'
ZARR2HDF
'
,
'
ZARR2Tif
'
]:
if
convertor
in
[
'
ZARR2HDF
'
,
'
ZARR2Tif
'
]:
raise
NotImplementedError
(
f
'
This convertor
{
convertor
}
is not yet implemented, please be patient
'
)
raise
NotImplementedError
(
f
'
This convertor
{
convertor
}
is not yet implemented, please be patient
'
)
...
...
This diff is collapsed.
Click to expand it.
ditb/commands/darkwhite.py
+
5
−
4
View file @
2d09dabf
...
@@ -5,10 +5,6 @@ This file is part of DITB.
...
@@ -5,10 +5,6 @@ This file is part of DITB.
Contains the cli interface for the dark white correction of the DISCO beam
Contains the cli interface for the dark white correction of the DISCO beam
"""
"""
from
ditb.exposure.darkwhite_correction
import
correct_dark_white
from
ditb.filters.smooth
import
smooth_to_zarr
from
pathlib
import
Path
import
shutil
import
click
import
click
@click.command
()
@click.command
()
...
@@ -36,6 +32,11 @@ def darkwhite(images, dark, white, darkofwhite, white_z, force, lower, smooth, v
...
@@ -36,6 +32,11 @@ def darkwhite(images, dark, white, darkofwhite, white_z, force, lower, smooth, v
the white image stack.
the white image stack.
"""
"""
# Do the import in the function to speed up the cli
from
ditb.exposure.darkwhite_correction
import
correct_dark_white
from
ditb.filters.smooth
import
smooth_to_zarr
from
pathlib
import
Path
import
shutil
if
dark
is
None
:
if
dark
is
None
:
raise
NotImplementedError
(
'
No dark option is not implemented
'
)
raise
NotImplementedError
(
'
No dark option is not implemented
'
)
...
...
This diff is collapsed.
Click to expand it.
ditb/commands/stitch.py
+
16
−
13
View file @
2d09dabf
...
@@ -5,11 +5,8 @@ This file is part of DITB.
...
@@ -5,11 +5,8 @@ This file is part of DITB.
Contains the cli interface for the stitching of tiles
Contains the cli interface for the stitching of tiles
"""
"""
from
ditb.io.metadata
import
read_mmzarr_metadata
from
ditb.stitching.tiles
import
create_mosaic
from
pathlib
import
Path
import
click
import
click
import
shutil
@click.command
()
@click.command
()
@click.argument
(
'
images
'
,
nargs
=-
1
,
type
=
click
.
Path
(
exists
=
True
))
@click.argument
(
'
images
'
,
nargs
=-
1
,
type
=
click
.
Path
(
exists
=
True
))
...
@@ -19,6 +16,12 @@ def stitch(images, force):
...
@@ -19,6 +16,12 @@ def stitch(images, force):
🪟 Stitch tiles from a zarr dataset to create a mosaic.
🪟 Stitch tiles from a zarr dataset to create a mosaic.
"""
"""
# Do the import in the function for cli speed
from
ditb.io.metadata
import
read_mmzarr_metadata
from
ditb.stitching.tiles
import
create_mosaic
from
pathlib
import
Path
import
shutil
print
(
f
'
🪩 Stitch data
'
)
print
(
f
'
🪩 Stitch data
'
)
for
filein
in
images
:
for
filein
in
images
:
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
2d09dabf
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
[project]
name
=
"DITB"
name
=
"DITB"
version
=
"20250108rc
2
"
version
=
"20250108rc
3
"
readme
=
"README.md"
readme
=
"README.md"
requires-python
=
">
=
3.11
"
requires-python
=
">
=
3.11
"
authors
=
[
{
name
=
"Hugo Chauvet"
,
email
=
"hugo.chauvet@synchrotron-soleil.fr"
}
]
authors
=
[
{
name
=
"Hugo Chauvet"
,
email
=
"hugo.chauvet@synchrotron-soleil.fr"
}
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment