Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
luiztauffer committed Nov 22, 2024
1 parent db6dbd8 commit 7222448
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 37 deletions.
31 changes: 11 additions & 20 deletions examples/example_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)


service_name = os.getenv('DENDRO_SERVICE_NAME', 'luiz-dandihub-service')
service_name = os.getenv("DENDRO_SERVICE_NAME", "luiz-dandihub-service")


# Using this file: https://dandiarchive.org/dandiset/000350/0.240822.1759/files?location=sub-20161022-1&page=1
Expand All @@ -21,41 +21,32 @@ def main():
"timepoints": 1000,
}
job_def = DendroJobDefinition(
appName='voluseg',
processorName='voluseg_processor',
appName="voluseg",
processorName="voluseg_processor",
inputFiles=[
DendroJobInputFile(
name='input',
fileBaseName='sub-20161022-1',
name="input",
fileBaseName="sub-20161022-1",
url="https://dandiarchive.s3.amazonaws.com/blobs/057/ecb/057ecbef-e732-4e94-8d99-40ebb74d346e",
)
],
outputFiles=[
DendroJobOutputFile(
name='output',
fileBaseName='output.txt'
)
],
outputFiles=[DendroJobOutputFile(name="output", fileBaseName="output.txt")],
parameters=[
DendroJobParameter(name=k, value=v)
for k, v in parameters_dict.items()
]
DendroJobParameter(name=k, value=v) for k, v in parameters_dict.items()
],
)
required_resources = DendroJobRequiredResources(
numCpus=24,
numGpus=0,
memoryGb=120,
timeSec=6*3600
numCpus=24, numGpus=0, memoryGb=120, timeSec=6 * 3600
)
job = submit_job(
service_name=service_name,
job_definition=job_def,
required_resources=required_resources,
target_compute_client_ids=["*"],
tags=['example'],
tags=["example"],
)
print(job.job_url, job.status)


if __name__ == '__main__':
if __name__ == "__main__":
main()
11 changes: 6 additions & 5 deletions voluseg/VolusegProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@


class VolusegProcessor(ProcessorBase):
name = 'voluseg_processor'
description = 'Run Voluseg for volumetric segmentation.'
label = 'voluseg_processor'
image = 'ghcr.io/catalystneuro/dendro-voluseg:latest'
executable = '/app/main.py'
name = "voluseg_processor"
description = "Run Voluseg for volumetric segmentation."
label = "voluseg_processor"
image = "ghcr.io/catalystneuro/dendro-voluseg:latest"
executable = "/app/main.py"
attributes = {}

@staticmethod
def run(context: VolusegContext):
import os

# import lindi
import voluseg

Expand Down
14 changes: 8 additions & 6 deletions voluseg/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@


class VolusegContext(BaseModel):
input: InputFile = Field(description='Input NWB file in .nwb or .nwb.lindi.tar format')
output: OutputFile = Field(description='Output embedding in .lindi.tar format')
input: InputFile = Field(
description="Input NWB file in .nwb or .nwb.lindi.tar format"
)
output: OutputFile = Field(description="Output embedding in .lindi.tar format")
detrending: str = Field(
default="standard",
description="Type of detrending: 'standard', 'robust', or 'none'",
json_schema_extra={'options': ["standard", "robust", "none"]},
json_schema_extra={"options": ["standard", "robust", "none"]},
)
registration: str = Field(
default="medium",
description="Quality of registration: 'high', 'medium', 'low' or 'none'",
json_schema_extra={'options': ["high", "medium", "low", "none"]},
json_schema_extra={"options": ["high", "medium", "low", "none"]},
)
registration_restrict: str = Field(
default="",
Expand Down Expand Up @@ -49,12 +51,12 @@ class VolusegContext(BaseModel):
type_timepoints: str = Field(
default="dff",
description="Type of timepoints to use for cell detection: 'dff', 'periodic' or 'custom'",
json_schema_extra={'options': ["dff", "periodic", "custom"]},
json_schema_extra={"options": ["dff", "periodic", "custom"]},
)
type_mask: str = Field(
default="geomean",
description="Type of volume averaging for mask: 'mean', 'geomean' or 'max'",
json_schema_extra={'options': ["mean", "geomean", "max"]},
json_schema_extra={"options": ["mean", "geomean", "max"]},
)
timepoints: int = Field(
default=1000,
Expand Down
9 changes: 3 additions & 6 deletions voluseg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
from VolusegProcessor import VolusegProcessor


app = App(
app_name='voluseg',
description='Voluseg processors'
)
app = App(app_name="voluseg", description="Voluseg processors")

app.add_processor(VolusegProcessor)


if __name__ == '__main__':
app.run()
if __name__ == "__main__":
app.run()

0 comments on commit 7222448

Please sign in to comment.