diff --git a/jupyter_workflow/client/client.py b/jupyter_workflow/client/client.py index e480ac0..6b1e714 100644 --- a/jupyter_workflow/client/client.py +++ b/jupyter_workflow/client/client.py @@ -100,9 +100,9 @@ async def _async_poll_for_workflow_reply( if msg["parent_header"].get("msg_id") == msg_id: if self.record_timing: for cell in cells: - cell["metadata"]["execution"][ - "shell.execute_reply" - ] = timestamp(msg) + cell["metadata"]["execution"]["shell.execute_reply"] = ( + timestamp(msg) + ) await asyncio.wait_for(task_poll_output_msgs, self.iopub_timeout) task_poll_kernel_alive.cancel() return msg diff --git a/jupyter_workflow/ipython/ipkernel.py b/jupyter_workflow/ipython/ipkernel.py index 795099c..98b0644 100644 --- a/jupyter_workflow/ipython/ipkernel.py +++ b/jupyter_workflow/ipython/ipkernel.py @@ -107,9 +107,7 @@ def init_metadata(self, parent): workflow_config = ( parent["metadata"] if "workflow" in parent["metadata"] - else parent["content"] - if "workflow" in parent["content"] - else None + else parent["content"] if "workflow" in parent["content"] else None ) if workflow_config is not None: try: diff --git a/jupyter_workflow/streamflow/processor.py b/jupyter_workflow/streamflow/processor.py index 8af9d86..a07032b 100644 --- a/jupyter_workflow/streamflow/processor.py +++ b/jupyter_workflow/streamflow/processor.py @@ -31,9 +31,9 @@ async def process( connector=self._get_connector(connector, job), job=job, locations=await self._get_locations(connector, job), - output_directory=self.target.workdir - if self.target - else job.output_directory, + output_directory=( + self.target.workdir if self.target else job.output_directory + ), user_ns=command_output.user_ns, value=self.value, value_from=self.value_from, diff --git a/jupyter_workflow/streamflow/step.py b/jupyter_workflow/streamflow/step.py index 735d46a..da78f5c 100644 --- a/jupyter_workflow/streamflow/step.py +++ b/jupyter_workflow/streamflow/step.py @@ -154,8 +154,7 @@ async def run(self): @abstractmethod async def process_input( self, job: Job, user_ns: MutableMapping[str, Any], token_value: Any - ) -> Token: - ... + ) -> Token: ... class JupyterFileInputInjectorStep(JupyterInputInjectorStep): @@ -337,9 +336,9 @@ def add_output_port( self, name: str, port: Port, output_processor: CommandOutputProcessor = None ) -> None: super().add_output_port(name, port) - self.output_processors[ - name - ] = output_processor or DefaultCommandOutputProcessor(name, self.workflow) + self.output_processors[name] = ( + output_processor or DefaultCommandOutputProcessor(name, self.workflow) + ) def get_output_context_port(self) -> ProgramContextPort: return cast(ProgramContextPort, self.get_output_port("__context__")) diff --git a/jupyter_workflow/streamflow/translator.py b/jupyter_workflow/streamflow/translator.py index 4d9f611..b8c8a2c 100644 --- a/jupyter_workflow/streamflow/translator.py +++ b/jupyter_workflow/streamflow/translator.py @@ -780,24 +780,24 @@ async def _translate_streamflow_cell( # If type is equal to `file`, it refers to a file path in the remote resource if element_type == "file": # Add file output processor to the execute step - step.output_processors[ - name - ] = JupyterFileCommandOutputProcessor( - name=name, - workflow=workflow, - value=element.get("value"), - value_from=element.get("valueFrom"), + step.output_processors[name] = ( + JupyterFileCommandOutputProcessor( + name=name, + workflow=workflow, + value=element.get("value"), + value_from=element.get("valueFrom"), + ) ) # If type is equal to `name` or `env`, it refers to a variable elif element_type in ["name", "env"]: # Add name output processor to the execute step - step.output_processors[ - name - ] = JupyterNameCommandOutputProcessor( - name=name, - workflow=workflow, - value=element.get("value"), - value_from=element.get("valueFrom", name), + step.output_processors[name] = ( + JupyterNameCommandOutputProcessor( + name=name, + workflow=workflow, + value=element.get("value"), + value_from=element.get("valueFrom", name), + ) ) # If type is equal to `control`, simply add an empty dependency elif element_type == "control": @@ -816,9 +816,11 @@ async def _translate_streamflow_cell( cell_id=metadata["cell_id"], name=name, port=self.output_ports[name], - depth=len(scatter_inputs) - if scatter_method == "cartesian" - else 1, + depth=( + len(scatter_inputs) + if scatter_method == "cartesian" + else 1 + ), workflow=workflow, ) # Add list join transformer diff --git a/lint-requirements.txt b/lint-requirements.txt index ea1f777..508c2d3 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,4 +1,4 @@ -black==23.9.1 +black==24.10.0 codespell==2.3.0 flake8-bugbear==23.9.16 pyupgrade==3.17.0 \ No newline at end of file