Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
e15f2620
Commit
e15f2620
authored
6 years ago
by
Victor Poughon
Browse files
Options
Downloads
Patches
Plain Diff
DOC: sort examples by tag and fix data handling
parent
70da6c02
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Cookbook/Scripts/RunExamples.py
+4
-4
4 additions, 4 deletions
Documentation/Cookbook/Scripts/RunExamples.py
Documentation/Cookbook/Scripts/otbGenerateExamplesRstDoc.py
+1
-1
1 addition, 1 deletion
Documentation/Cookbook/Scripts/otbGenerateExamplesRstDoc.py
with
5 additions
and
5 deletions
Documentation/Cookbook/Scripts/RunExamples.py
+
4
−
4
View file @
e15f2620
...
...
@@ -33,7 +33,7 @@ blacklist = [
"
LAIAndPROSAILToSensorResponse
"
# does not run, wrong arguments
]
def
run_example
(
otb_root
,
otb_data
,
name
,
dry_run
):
def
run_example
(
otb_root
,
name
,
dry_run
):
"""
Run an example by name
Assumes the current working directory is an OTB build
...
...
@@ -71,6 +71,7 @@ def run_example(otb_root, otb_data, name, dry_run):
print
(
"
$
"
+
binary
+
"
"
+
"
"
.
join
(
example_args
))
if
not
dry_run
:
otb_data
=
join
(
otb_root
,
"
Data
"
)
# Make sure Output dir exists
os
.
makedirs
(
join
(
otb_data
,
"
Output
"
),
exist_ok
=
True
)
...
...
@@ -81,19 +82,18 @@ def run_example(otb_root, otb_data, name, dry_run):
def
main
():
parser
=
argparse
.
ArgumentParser
(
usage
=
"
Run one or all OTB cxx examples
"
)
parser
.
add_argument
(
"
otb_root
"
,
help
=
"
Path to otb repository
"
)
parser
.
add_argument
(
"
otb_data
"
,
help
=
"
Path to otb-data repository
"
)
parser
.
add_argument
(
"
--name
"
,
type
=
str
,
help
=
"
Run only one example with then given name
"
)
parser
.
add_argument
(
"
-n
"
,
"
--dry-run
"
,
action
=
'
store_true
'
,
help
=
"
Dry run, only print commands
"
)
parser
.
add_argument
(
"
-k
"
,
"
--keep-going
"
,
action
=
'
store_true
'
,
help
=
"
Keep going after failing examples
"
)
args
=
parser
.
parse_args
()
if
args
.
name
:
run_example
(
args
.
otb_root
,
args
.
otb_data
,
args
.
name
,
dry_run
=
args
.
dry_run
)
run_example
(
args
.
otb_root
,
args
.
name
,
dry_run
=
args
.
dry_run
)
else
:
list_of_examples
=
[
os
.
path
.
splitext
(
os
.
path
.
basename
(
f
))[
0
]
for
f
in
glob
.
glob
(
join
(
args
.
otb_root
,
"
Examples/*/*.cxx
"
))]
for
name
in
list_of_examples
:
try
:
run_example
(
args
.
otb_root
,
args
.
otb_data
,
name
,
dry_run
=
args
.
dry_run
)
run_example
(
args
.
otb_root
,
name
,
dry_run
=
args
.
dry_run
)
except
Exception
as
e
:
if
args
.
keep_going
:
print
(
"
Warning:
"
,
e
)
...
...
This diff is collapsed.
Click to expand it.
Documentation/Cookbook/Scripts/otbGenerateExamplesRstDoc.py
+
1
−
1
View file @
e15f2620
...
...
@@ -44,7 +44,7 @@ def generate_examples_index(rst_dir, list_of_examples):
index_f
=
open
(
join
(
rst_dir
,
"
Examples.rst
"
),
"
w
"
)
index_f
.
write
(
RstPageHeading
(
"
C++ Examples
"
,
3
,
ref
=
"
cpp-examples
"
))
for
tag
,
examples_filenames
in
tag_files
.
items
():
for
tag
,
examples_filenames
in
sorted
(
tag_files
.
items
()
)
:
tag_filename
=
join
(
"
Examples
"
,
tag
+
"
.rst
"
)
index_f
.
write
(
"
\t
"
+
tag_filename
+
"
\n
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment