Comments (5)
Sure, I would happily review a PR to accomplish this
from cwl-upgrader.
Currently I have a plan to revise the signature as follows.
def upgrade_document(
document: Any,
pack: bool, # return a packed object or do not process external CWL doc in `run` fields
output_dir: Optional[str] = None, # dump upgraded documents if provided
target_version: Optional[str] = "latest", # Issue #77
imports: Optional[Set[str]] = None,
) -> Any:
...
or
# omit output_dir option not to write resulted files
def upgrade_document(
document: Any,
pack: bool, # return a packed object or do not process external CWL doc in `run` fields
target_version: Optional[str] = "latest", # Issue #77
imports: Optional[Set[str]] = None,
) -> Any:
...
I prefer the latter because we can focus on upgrading a given CWL document and easily integrate with other output functions.
from cwl-upgrader.
I prefer the latter because we can focus on upgrading a given CWL document and easily integrate with other output functions.
What if we're not packing? How are the upgraded documents for each step returned to the caller?
from cwl-upgrader.
What if we're not packing?
In my plan, it only upgrades a given CWL document and leaves other documents referred as a path or a URI in run
fields as is (on the other hand, embedded documents are upgraded).
It covers the use case in which a given CWL refers external URI that is not owned by users.
How are the upgraded documents for each step returned to the caller?
There are several use cases but we do not have to support them directly with upgrade_document
, IMO.
- All step documents are located in the same directory as a given workflow document (
dir/workflow.cwl
,dir/step1.cwl
,dir/step2.cwl
...).- We can simply apply
upgrade_document
to all the documents in the directory.
- We can simply apply
- Some documents are located in the server (e.g.,
https://raw.githubusercontent.com/.../step1.cwl
: current implementation does not support this case)- Fetching external documents should be done in other function (will be provided in cwl-utils?).
- A workflow documents and all step documents are located in different directories (
dir/workflow.cwl
,dir/steps/step1.cwl
,dir/steps/step2.cwl
...).- IMO it is not a good idea to support this case with
upgrade_document
because it contains dangerous cases. For example, consider the case ofdir/workflow/workflow.cwl
anddir/tools/step1.cwl
.dir/workflow/workflow.cwl
refersdir/tools/step1.cwl
asrun: ../tools/step1.cwl
. Ifupgrade_document
upgrades all the documents with keeping its directory structure, it accidentally outputs files outside the specifiedoutput_dir
. Other handling (e.g., upgrade documents without keeping directory structure, warning if trying to output files outside a givenoutput_dir
) only covers some use cases. - It is better to make directories by hand to fit users' requirements.
- IMO it is not a good idea to support this case with
from cwl-upgrader.
Sounds like you are suggesting we specialize the function into 2 different functions (that share code):
- Single document only, returned as JSON-compatible objects (may result in mixed versions)
- One or more documents on disk, either updated in place or output to a new directory
and that both options also accept a URL to a remote document (necessitating an output directory in the case of 2)
I find this an agreeable plan. The interface is more useful and no functionality is lost.
from cwl-upgrader.
Related Issues (20)
- Expected <block end>, but found '<scalar>' HOT 1
- Workflow missing required 'in' and 'out' fields HOT 2
- eventually support re-writing DockerGpuRequirement
- add draft-2 to v1.x support
- Imports inside the requirements block cause cwl-upgrader to fail HOT 1
- Upgrade to v1.1 should un-prefix cwltool:InplaceInputRequirement HOT 1
- upgrade to cwl v1.1 should move Workflow level inputBindings to a label, doc, or comment
- CWL v1.1: `cwltool:loadListing` extension req into a unprefixed `LoadListingRequirement` HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- shebang line duplicated
- cwl-runner validate fails after upgrade HOT 12
- Re-upgrading CWL files HOT 1
- Unifying target version parameter for `upgrade_document` HOT 1
- long form arrays aren't being converted correctly HOT 2
- tests: upgrade all the CWL v1.0 conformance tests and confirm the results HOT 5
- upgrading packed document → "No such file or directory: #echo"
- unicode failure on Python 3.5 HOT 1
- Upgrade a cwl 1.2 workflow fails HOT 2
- CommandLineTool field types become illegal after upgrading to v1.2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cwl-upgrader.