Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ICARTT Python Package
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MBEES
ICARTT Python Package
Commits
d7538c91
Commit
d7538c91
authored
Feb 17, 2022
by
Florian Obersteiner
Browse files
Options
Downloads
Patches
Plain Diff
do not ignore arbitrary Exceptions
parent
fcdf7fe4
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
introduction of pathlib.Path
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_dataset.py
+24
-24
24 additions, 24 deletions
tests/test_dataset.py
with
24 additions
and
24 deletions
tests/test_dataset.py
+
24
−
24
View file @
d7538c91
...
...
@@ -35,18 +35,18 @@ def compareFiles(fn, strIn, strOut, skiplines=0, nlines=-1): # pragma: no cover
valid_data_line
=
False
# maybe this is a data line in which we only have different number formatting?
# compare as floats
try
:
#
try:
insteps
=
[
float
(
x
)
for
x
in
inline
.
split
(
"
,
"
)]
outsteps
=
[
float
(
x
)
for
x
in
outline
.
split
(
"
,
"
)]
if
len
(
insteps
)
==
len
(
outsteps
):
valid_data_line
=
True
for
i
in
range
(
len
(
insteps
)):
valid_data_line
=
valid_data_line
and
insteps
[
i
]
==
outsteps
[
i
]
except
:
pass
#
except:
#
pass
valid_var_line
=
False
try
:
#
try:
insteps
=
[
x
.
strip
()
for
x
in
inline
.
split
(
"
,
"
)]
outsteps
=
[
x
.
strip
()
for
x
in
outline
.
split
(
"
,
"
)]
if
len
(
insteps
)
==
2
and
len
(
outsteps
)
==
3
:
...
...
@@ -55,13 +55,13 @@ def compareFiles(fn, strIn, strOut, skiplines=0, nlines=-1): # pragma: no cover
and
insteps
[
1
]
==
outsteps
[
1
]
and
insteps
[
1
]
==
outsteps
[
2
]
)
except
:
pass
#
except:
#
pass
if
not
valid_data_line
and
not
valid_var_line
:
print
(
"
{
:
s}: line {:d} differs:
"
.
format
(
fn
,
i
)
)
print
(
"
input: {
:s}
"
.
format
(
inline
)
)
print
(
"
output: {
:s}
"
.
format
(
outline
)
)
print
(
f
"
{
s
tr
(
fn
)
}
: line
{
i
:
d
}
differs:
"
)
print
(
f
"
input:
{
inline
}
"
)
print
(
f
"
output:
{
outline
}
"
)
return
False
...
...
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