Skip to content

Ogs auto wrap#130

Open
tStehling wants to merge 32 commits into
Helmholtz-UFZ:mainfrom
tStehling:ogsAutoWrap
Open

Ogs auto wrap#130
tStehling wants to merge 32 commits into
Helmholtz-UFZ:mainfrom
tStehling:ogsAutoWrap

Conversation

@tStehling
Copy link
Copy Markdown
Collaborator

Automatic extraction of information and xml galaxy wrap creation for OGS tools.

Copy link
Copy Markdown
Collaborator

@bernt-matthias bernt-matthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The macros files and the tool files need to be in the same directory.

Ultimately the tools should be generated in the ogs dir, or?

Comment thread tools/ogsAutowrap/generated_tools/AddElementQuality.xml Outdated
Comment thread tools/ogsAutowrap/generated_tools/AddElementQuality.xml Outdated
Comment thread tools/ogsAutowrap/generated_tools/AddElementQuality.xml Outdated
Comment thread tools/ogsAutowrap/generated_tools/AddElementQuality.xml Outdated
Comment thread tools/ogsAutowrap/generated_tools/AddElementQuality.xml
Comment thread tools/ogsAutowrap/macros.xml
Comment thread tools/ogsAutowrap/generated_tools/AddFaultToVoxelGrid.xml Outdated
Copy link
Copy Markdown
Collaborator

@bernt-matthias bernt-matthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more comments. Would be nice if you could check with planemo lint / serve if the tools are correct.

Comment thread tools/ogsAutowrap/generated_tools/AssignRasterDataToMesh.xml Outdated
<param name="node_array" type="boolean" label="node array" help="Assigns raster data to node array (default)" checked="false" truevalue="--node-array" falsevalue=""/>
<param name="scalar_name" type="text" optional="false" label="scalar name" help="The name of the newly created scalar array."/>
<param name="raster" type="data" optional="false" label="raster" help="Name of the input raster file " format="asc" multiple="false"/>
<param name="input" type="data" optional="false" label="input" help="Name of the input mesh file, " format="vtu" multiple="false"/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no vtu datattype. Also many of the other data types are not yet in Galaxy. We should discuss a mapping / implementing them in Galaxy.

Copy link
Copy Markdown
Collaborator

@bernt-matthias bernt-matthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Create .shed.yml.
  • removce saqc changes from this PR

</inputs>
<outputs>
<collection name="tool_outputs" type="list" label="Outputs from AddElementQuality">
<discover_datasets pattern="output_.+\..+" format="auto" visible="true"/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pattern does not work like this. you find some examples here: https://planemo.readthedocs.io/en/latest/writing_advanced.html#examples

the easiest would be if __designation_and_ext__ would work (requires that ogs extensions match the Galaxy datatype names .. which we might achieve with a bit of file renaming?)

</collection>
</outputs>
<tests>
<expand macro="ogsutilssuite_tests"/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably only want to include the tests for this tool, i.e. you need one macro per tool (but they can and should be in the same folder).

<param name="nodata" type="float" value="false" optional="false" label="nodata" help="The no data value used for missing values, " min="0"/>
<param name="cell_array" type="boolean" label="cell array" help="Assigns raster data to cell array" checked="false" truevalue="--cell-array" falsevalue=""/>
<param name="node_array" type="boolean" label="node array" help="Assigns raster data to node array (default)" checked="false" truevalue="--node-array" falsevalue=""/>
<param name="scalar_name" type="text" optional="false" label="scalar name" help="The name of the newly created scalar array."/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional has no meaning for text parameters. Should be removed. Add a no_value validator instead.

<inputs>
<param name="shape_file" type="data" optional="false" label="shape file" help="the name of the input shape " format="shp" multiple="false"/>
</inputs>
<outputs/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No outputs here?

#for $f in $input:
--input '$f'
#end for
#for $f in $json_file:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for loop needed (actually wrong) if multiple = false

#end for
--output output_1.vtp]]></command>
<inputs>
<param name="gamma" type="float" value="smaller or larger values indicate a logarithmic or &quot;&#10; &quot;exponential increase" optional="false" label="gamma" help="Exponental increase coefficient. A value of "/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was ist &quot;&#10; &quot; im original?

Comment thread tools/ogsAutowrap/gen.py Outdated
)

# --- CONFIGURATION ---
OGS_REPO_PATH = Path("/home/stehling/gitProjects/ogs")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waere schoen, wenn das ein command line parameter sein koennte.

Comment thread tools/ogsAutowrap/gen.py Outdated
return re.sub(r'[^a-zA-Z0-9_]+', '_', name)

def discover_tools() -> List[Dict[str, Any]]:
"""Scans the OGS repo and finds tools using multiple regex patterns."""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vlt noch etwas mehr docs. Die Funktion sucht ja auch schon alle parameter raus, oder?

Comment thread tools/ogsAutowrap/gen.py Outdated
Comment on lines +115 to +116
"-1*std::numeric_limits<double>::max()": "-1.7976931348623157E+308",
"-1 * std::numeric_limits<double>::max()": "-1.7976931348623157E+308",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statt eines extra eintrags fuer -1*... und -1 * ... koennte man auch etwas robuster mit regexp ersetzen?

Comment thread tools/ogsAutowrap/gen.py
full_arg_text = ' '.join(full_arg_text.replace('"', '').replace('\\n', ' ').split())
full_arg_text_lower = full_arg_text.lower()

if not long_flag:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was sing diese long_flag? also was wird hier geskipped?

Copy link
Copy Markdown
Collaborator

@bernt-matthias bernt-matthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge into ogs folder

Comment thread tools/ogsAutowrap/addDataToRaster.xml Outdated
--output_raster output_1.asc
]]></command>
<inputs>
<param name="scaling_value" type="float" optional="true" label="scaling value" help="value the function sin(x pi) sin(y pi) will be scaled with" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scaling_value has a default.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add argument

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line not needed.

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<tool name="OGS: addDataToRaster" id="ogs_adddatatoraster" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.01">
<description>Galaxy wrapper for the OGS utility 'addDataToRaster'.</description>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description does not help. Remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants