Skip to content

Commit

Permalink
Merge pull request #65 from PMCC-BioinformaticsCore/release-v0.12.0
Browse files Browse the repository at this point in the history
Release v0.12.0
  • Loading branch information
rlupat authored Jun 14, 2023
2 parents a5ea7bf + 6163086 commit fcb68f1
Show file tree
Hide file tree
Showing 15 changed files with 753 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Unit Tests

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -23,4 +23,4 @@ jobs:
- name: Test with nosetests
run: |
nosetests -w janis_assistant --with-coverage --cover-package=janis_assistant
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion janis_assistant/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def process_args(sysargs=None):
)
add_translate_args(
subparsers.add_parser(
"translate", help="Translate a janis workflow to CWL or WDL"
"translate", help="Translate a janis workflow to CWL, WDL, or Nextflow"
)
)
add_inputs_args(
Expand Down
6 changes: 6 additions & 0 deletions janis_assistant/data/models/preparedjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from janis_assistant.management.configuration import (
parse_if_dict,
JanisConfigurationCromwell,
JanisConfigurationNextflow,
JanisConfigurationTemplate,
JanisConfigurationNotifications,
JanisConfigurationEnvironment,
Expand Down Expand Up @@ -66,6 +67,7 @@ def __init__(
container_type: str = None,
workflow_reference: str = None,
post_run_script: str = None,
nextflow: JanisConfigurationNextflow = None
):
"""
Expand Down Expand Up @@ -116,6 +118,10 @@ def __init__(
"cromwell",
skip_if_empty=not requires_cromwell_config,
)
requires_nextflow_config = self.engine == EngineType.nextflow
self.nextflow: JanisConfigurationNextflow = parse_if_dict(
JanisConfigurationNextflow, nextflow or {}, "nextflow", skip_if_empty=not requires_nextflow_config
)
self.template: JanisConfigurationTemplate = parse_if_dict(
JanisConfigurationTemplate, template or {}, "template", skip_if_empty=False
)
Expand Down
2 changes: 1 addition & 1 deletion janis_assistant/data/models/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def format(self, **kwargs):
errors.extend(r.error for r in self.runs if r.error)

rstatuses = ", ".join(
str(r.status.to_string()) for r in self.runs if r.status
str(r.status) for r in self.runs if r.status
)

statuses = self.status.to_string() if self.status else rstatuses
Expand Down
6 changes: 6 additions & 0 deletions janis_assistant/engines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .cromwell import Cromwell, CromwellConfiguration
from .enginetypes import EngineType
from .cwltool.main import CWLTool
from .nextflow.main import Nextflow
from .engine import Engine
from janis_core import SupportedTranslation

Expand All @@ -15,6 +16,9 @@ def get_ideal_specification_for_engine(eng: Engine):
elif isinstance(eng, Toil):
return SupportedTranslation.CWL

elif isinstance(eng, Nextflow):
return SupportedTranslation.Nextflow

return SupportedTranslation.CWL


Expand All @@ -26,5 +30,7 @@ def get_engine_type(engtype: Union[str, EngineType]):
return CWLTool
elif engid == EngineType.toil.value:
return Toil
elif engid == EngineType.nextflow.value:
return Nextflow

raise Exception("Couldn't recognise engine type ")
11 changes: 10 additions & 1 deletion janis_assistant/engines/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ def terminate_task(self, identifier) -> TaskStatus:

@abstractmethod
def metadata(self, identifier) -> RunModel:
pass
return RunModel(
id_=identifier,
engine_id=identifier,
execution_dir=None,
submission_id=None,
name=identifier,
status=self.taskmeta.get("status"),
jobs=list(self.taskmeta.get("jobs", {}).values()),
error=self.taskmeta.get("error"),
)

keys_to_ignore = {"progress_callbacks"}

Expand Down
3 changes: 2 additions & 1 deletion janis_assistant/engines/enginetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ class EngineType(Enum):
cromwell = "cromwell"
cwltool = "cwltool"
toil = "toil"
nextflow = "nextflow"

def __str__(self):
return self.value

@staticmethod
def engines():
return [EngineType.cwltool.value, EngineType.cromwell.value]
return [EngineType.cwltool.value, EngineType.cromwell.value, EngineType.nextflow.value]
Empty file.
Loading

0 comments on commit fcb68f1

Please sign in to comment.