Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lde-api-regression-test
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
Harbor Registry
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
simcaq
lde-api-regression-test
Commits
3085abd4
Commit
3085abd4
authored
5 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
Fix comma error and generic max year
parent
24b1ce79
No related branches found
No related tags found
No related merge requests found
Pipeline
#23252
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
regression_test.py
+5
-2
5 additions, 2 deletions
regression_test.py
with
5 additions
and
2 deletions
regression_test.py
+
5
−
2
View file @
3085abd4
...
@@ -25,6 +25,8 @@ import numpy as np
...
@@ -25,6 +25,8 @@ import numpy as np
import
settings
import
settings
from
termcolor
import
colored
,
cprint
from
termcolor
import
colored
,
cprint
maxYear
=
2019
class
RegressionTest
:
class
RegressionTest
:
def
__init__
(
self
,
route
):
def
__init__
(
self
,
route
):
...
@@ -41,7 +43,8 @@ class RegressionTest:
...
@@ -41,7 +43,8 @@ class RegressionTest:
if
len
(
route
)
>
1
:
if
len
(
route
)
>
1
:
arguments
=
arguments
.
join
(
route
[
1
:])
arguments
=
arguments
.
join
(
route
[
1
:])
file_name
=
name
+
arguments
file_name
=
name
+
arguments
url
=
self
.
base_url
+
name
+
'
?filter=min_year:1991,max_year:2018,
'
+
arguments
+
'
&format=csv
'
url
=
self
.
base_url
+
name
+
'
?filter=min_year:1991,max_year:
'
+
str
(
maxYear
)
+
'
,
'
+
arguments
+
'
&format=csv
'
url
=
url
.
replace
(
"
,&format
"
,
"
&format
"
)
try
:
try
:
api_csv
=
pd
.
read_csv
(
url
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get from api
api_csv
=
pd
.
read_csv
(
url
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get from api
api_csv
.
to_csv
(
'
route_result/
'
+
file_name
+
'
.csv
'
,
encoding
=
"
utf-8-sig
"
)
#save
api_csv
.
to_csv
(
'
route_result/
'
+
file_name
+
'
.csv
'
,
encoding
=
"
utf-8-sig
"
)
#save
...
@@ -57,7 +60,7 @@ class RegressionTest:
...
@@ -57,7 +60,7 @@ class RegressionTest:
if
len
(
route
)
>
1
:
if
len
(
route
)
>
1
:
arguments
=
arguments
.
join
(
route
[
1
:])
arguments
=
arguments
.
join
(
route
[
1
:])
file_name
=
name
+
arguments
file_name
=
name
+
arguments
url
=
self
.
base_url
+
name
+
'
?filter=min_year:1991,max_year:
2018
,
'
+
arguments
+
'
&format=csv
'
url
=
self
.
base_url
+
name
+
'
?filter=min_year:1991,max_year:
'
+
str
(
maxYear
)
+
'
,
'
+
arguments
+
'
&format=csv
'
try
:
try
:
api_csv
=
pd
.
read_csv
(
url
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get from api
api_csv
=
pd
.
read_csv
(
url
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get from api
csv_route
=
pd
.
read_csv
(
'
route_result/
'
+
file_name
+
'
.csv
'
,
index_col
=
0
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get file
csv_route
=
pd
.
read_csv
(
'
route_result/
'
+
file_name
+
'
.csv
'
,
index_col
=
0
,
float_precision
=
'
round_trip
'
,
encoding
=
"
utf-8-sig
"
)
#get file
...
...
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