Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GalaxyWorkflow: improve parsing speed & codegen #108

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gxformat2/schema/v19_09.py
Original file line number Diff line number Diff line change
Expand Up @@ -6613,7 +6613,10 @@ def save(
booltype,
)
)
uri_strtype_False_True_None_None = _URILoader(strtype, False, True, None, None)
GalaxyWorkflow_classLoader = _EnumLoader(("GalaxyWorkflow",), "GalaxyWorkflow_class")
uri_GalaxyWorkflow_classLoader_False_True_None_None = _URILoader(
GalaxyWorkflow_classLoader, False, True, None, None
)
array_of_WorkflowInputParameterLoader = _ArrayLoader(WorkflowInputParameterLoader)
idmap_inputs_array_of_WorkflowInputParameterLoader = _IdMapLoader(
array_of_WorkflowInputParameterLoader, "id", "type"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface GalaxyWorkflow extends Process, HasUUID, Saveable {
/**
* Getter for property <I>https://galaxyproject.org/gxformat2/v19_09#GalaxyWorkflow/class</I><br>
*/
String getClass_();
GalaxyWorkflow_class getClass_();
/**
* Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><br>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public java.util.Optional<String> getId() {
return this.id;
}

private String class_;
private GalaxyWorkflow_class class_;

/**
* Getter for property <I>https://galaxyproject.org/gxformat2/v19_09#GalaxyWorkflow/class</I><br>
*/
public String getClass_() {
public GalaxyWorkflow_class getClass_() {
return this.class_;
}

Expand Down Expand Up @@ -310,10 +310,10 @@ public GalaxyWorkflowImpl(
} else {
__baseUri = (String) id.orElse(null);
}
String class_;
GalaxyWorkflow_class class_;
try {
class_ =
LoaderInstances.uri_StringInstance_False_True_None_None.loadField(
LoaderInstances.uri_GalaxyWorkflow_class_False_True_None_None.loadField(
__doc.get("class"), __baseUri, __loadingOptions);
} catch (ValidationException e) {
class_ = null; // won't be used but prevents compiler from complaining.
Expand Down Expand Up @@ -487,7 +487,7 @@ public GalaxyWorkflowImpl(
this.inputs = (java.util.List<Object>) inputs;
this.outputs = (java.util.List<Object>) outputs;
this.uuid = (java.util.Optional<String>) uuid;
this.class_ = (String) class_;
this.class_ = (GalaxyWorkflow_class) class_;
this.steps = (java.util.List<Object>) steps;
this.report = (java.util.Optional<Report>) report;
this.tags = (java.util.Optional<java.util.List<String>>) tags;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.galaxyproject.gxformat2.v19_09;

import org.galaxyproject.gxformat2.v19_09.utils.ValidationException;

public enum GalaxyWorkflow_class {
GALAXYWORKFLOW("GalaxyWorkflow");

private static String[] symbols = new String[] {"GalaxyWorkflow"};
private String docVal;

private GalaxyWorkflow_class(final String docVal) {
this.docVal = docVal;
}

public static GalaxyWorkflow_class fromDocumentVal(final String docVal) {
for (final GalaxyWorkflow_class val : GalaxyWorkflow_class.values()) {
if (val.docVal.equals(docVal)) {
return val;
}
}
throw new ValidationException(
String.format("Expected one of %s", GalaxyWorkflow_class.symbols, docVal));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConstantMaps {
vocab.put("EnumSchema", "https://w3id.org/cwl/salad#EnumSchema");
vocab.put("File", "https://galaxyproject.org/gxformat2/v19_09#GalaxyType/File");
vocab.put("GalaxyType", "https://galaxyproject.org/gxformat2/v19_09#GalaxyType");
vocab.put("GalaxyWorkflow", "https://galaxyproject.org/gxformat2/v19_09#GalaxyWorkflow");
vocab.put("GalaxyWorkflow", "GalaxyWorkflow");
vocab.put("HasStepErrors", "https://galaxyproject.org/gxformat2/gxformat2common#HasStepErrors");
vocab.put(
"HasStepPosition", "https://galaxyproject.org/gxformat2/gxformat2common#HasStepPosition");
Expand Down Expand Up @@ -72,7 +72,7 @@ public class ConstantMaps {
rvocab.put("https://w3id.org/cwl/salad#EnumSchema", "EnumSchema");
rvocab.put("https://galaxyproject.org/gxformat2/v19_09#GalaxyType/File", "File");
rvocab.put("https://galaxyproject.org/gxformat2/v19_09#GalaxyType", "GalaxyType");
rvocab.put("https://galaxyproject.org/gxformat2/v19_09#GalaxyWorkflow", "GalaxyWorkflow");
rvocab.put("GalaxyWorkflow", "GalaxyWorkflow");
rvocab.put(
"https://galaxyproject.org/gxformat2/gxformat2common#HasStepErrors", "HasStepErrors");
rvocab.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ public class LoaderInstances {
false,
2,
null);
public static Loader<String> uri_StringInstance_False_True_None_None =
new UriLoader(StringInstance, false, true, null, null);
public static Loader<GalaxyWorkflow_class> GalaxyWorkflow_class =
new EnumLoader(GalaxyWorkflow_class.class);
public static Loader<GalaxyWorkflow_class> uri_GalaxyWorkflow_class_False_True_None_None =
new UriLoader(GalaxyWorkflow_class, false, true, null, null);
public static Loader<java.util.List<WorkflowStep>> array_of_WorkflowStep =
new ArrayLoader(WorkflowStep);
public static Loader<java.util.List<Object>> idmap_steps_array_of_WorkflowStep =
Expand Down
7 changes: 5 additions & 2 deletions schema/v19_09/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,14 @@ $graph:
# doc: {$include: ../common/workflow_label_description.txt}
# # Legacy support - this may also be called 'name' and Galaxy will consume the workflow fine and treat this
# # attribute correctly - however in order to validate against this schema the attribute should be called label.
- name: "class"
- name: class
jsonldPredicate:
"_id": "@type"
"_type": "@vocab"
type: string
type:
type: enum
name: GalaxyWorkflow_class
symbols: [ gxformat2:GalaxyWorkflow ]
mvdbeek marked this conversation as resolved.
Show resolved Hide resolved
- name: steps
doc: {$include: ../common/steps_description.txt}
type:
Expand Down
2 changes: 1 addition & 1 deletion typescript/docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion typescript/docs/classes/GalaxyWorkflow.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions typescript/docs/enums/GalaxyWorkflow_class.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>GalaxyWorkflow_class | org.galaxyproject.gxformat2.v19_09</title><meta name="description" content="Documentation for org.galaxyproject.gxformat2.v19_09"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">org.galaxyproject.gxformat2.v19_09</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">org.galaxyproject.gxformat2.v19_09</a></li><li><a href="GalaxyWorkflow_class.html">GalaxyWorkflow_class</a></li></ul><h1>Enumeration GalaxyWorkflow_class </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Enumeration members</h3><ul class="tsd-index-list"><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="GalaxyWorkflow_class.html#GALAXYWORKFLOW" class="tsd-kind-icon">GALAXYWORKFLOW</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Enumeration members</h2><section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="GALAXYWORKFLOW" class="tsd-anchor"></a><h3 class="tsd-anchor-link">GALAXYWORKFLOW<a href="#GALAXYWORKFLOW" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">GALAXYWORKFLOW<span class="tsd-signature-symbol"> = &quot;GalaxyWorkflow&quot;</span></div><aside class="tsd-sources"><ul><li>Defined in src/GalaxyWorkflow_class.ts:3</li></ul></aside></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-enum"><a href="GalaxyWorkflow_class.html" class="tsd-kind-icon">Galaxy<wbr/>Workflow_<wbr/>class</a><ul><li class="tsd-kind-enum-member tsd-parent-kind-enum"><a href="GalaxyWorkflow_class.html#GALAXYWORKFLOW" class="tsd-kind-icon">GALAXYWORKFLOW</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
Loading
Loading