Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
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
Model registry
Operate
Environments
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
pranjal_dhole
Flatland
Commits
b2b5a62f
Commit
b2b5a62f
authored
2 years ago
by
adrian_egli2
Browse files
Options
Downloads
Patches
Plain Diff
Examples cleaned up
- unused imports removed - removed unused code are no ready for benchmarking
parent
b83b4269
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/run_all_examples.py
+15
-1
15 additions, 1 deletion
benchmarks/run_all_examples.py
with
15 additions
and
1 deletion
benchmarks/run_all_examples.py
+
15
−
1
View file @
b2b5a62f
...
...
@@ -9,7 +9,7 @@ from importlib_resources import path
from
benchmarks.benchmark_utils
import
swap_attr
print
(
"
run_all_examples.py
"
)
error_log_examples
=
{}
for
entry
in
[
entry
for
entry
in
importlib_resources
.
contents
(
'
examples
'
)
if
not
pkg_resources
.
resource_isdir
(
'
examples
'
,
entry
)
and
entry
.
endswith
(
"
.py
"
)
...
...
@@ -17,6 +17,7 @@ for entry in [entry for entry in importlib_resources.contents('examples') if
and
'
demo.py
'
not
in
entry
and
'
DELETE
'
not
in
entry
]:
with
path
(
'
examples
'
,
entry
)
as
file_in
:
print
(
""
)
print
(
""
)
...
...
@@ -25,6 +26,7 @@ for entry in [entry for entry in importlib_resources.contents('examples') if
print
(
"
*****************************************************************
"
)
print
(
"
Running {}
"
.
format
(
entry
))
print
(
"
*****************************************************************
"
)
with
swap_attr
(
sys
,
"
stdin
"
,
StringIO
(
"
q
"
)):
try
:
runpy
.
run_path
(
file_in
,
run_name
=
"
__main__
"
,
init_globals
=
{
...
...
@@ -32,5 +34,17 @@ for entry in [entry for entry in importlib_resources.contents('examples') if
})
except
Exception
as
e
:
print
(
e
)
error_log_examples
.
update
({
file_in
:
e
})
print
(
"
runpy done.
"
)
print
(
"
Done with {}
"
.
format
(
entry
))
if
len
(
error_log_examples
.
keys
())
>
0
:
print
(
"
*****************************************************************
"
)
print
(
"
Error log:
"
)
print
(
"
*****************************************************************
"
)
print
(
error_log_examples
)
print
(
"
*****************************************************************
"
)
else
:
print
(
"
*****************************************************************
"
)
print
(
"
All examples executed - no error.
"
)
print
(
"
*****************************************************************
"
)
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