Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AQ-Bench
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
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
AQ-Bench
Commits
e0705e7d
Commit
e0705e7d
authored
4 years ago
by
Clara Betancourt
Browse files
Options
Downloads
Plain Diff
Merge branch 'devel-intern' into master-intern
parents
4b0eecc4
adc7fe1e
Branches
master-intern
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
prepare.sh
+1
-1
1 addition, 1 deletion
prepare.sh
source/dataset_retrieval.py
+41
-2
41 additions, 2 deletions
source/dataset_retrieval.py
with
42 additions
and
3 deletions
prepare.sh
+
1
−
1
View file @
e0705e7d
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# venv is created in this directory.
# venv is created in this directory.
# check if we are really in the ozone-mapping directory
# check if we are really in the ozone-mapping directory
S
=
"
ozone-mapping
"
S
=
"
aq-bench
"
if
[[
$(
pwd
)
==
*
$S
]]
if
[[
$(
pwd
)
==
*
$S
]]
then
then
echo
"Prepare..."
echo
"Prepare..."
...
...
This diff is collapsed.
Click to expand it.
source/dataset_retrieval.py
+
41
−
2
View file @
e0705e7d
...
@@ -193,7 +193,8 @@ class AQbench():
...
@@ -193,7 +193,8 @@ class AQbench():
save_data_to_file
(
self
.
data
,
self
.
data_dir
+
'
AQbench.csv
'
)
save_data_to_file
(
self
.
data
,
self
.
data_dir
+
'
AQbench.csv
'
)
logging
.
warning
(
"""
Do not forget to improve the population density
logging
.
warning
(
"""
Do not forget to improve the population density
of id 4589 and throw out station id 4587
of id 4589 and throw out station id 4587
because of very high ozone values reported there
"""
)
because of very high ozone values reported there.
Also, drop station without metadata.
"""
)
logging
.
info
(
'
AQbench complete
'
)
logging
.
info
(
'
AQbench complete
'
)
...
@@ -418,6 +419,43 @@ class MetricsRow():
...
@@ -418,6 +419,43 @@ class MetricsRow():
+
'
'
+
print_metric
+
'
:
'
+
str
(
self
.
row
[
print_metric
]))
+
'
'
+
print_metric
+
'
:
'
+
str
(
self
.
row
[
print_metric
]))
def
data_capture
():
"""
A simple function to look at the data capture of our metrics.
"""
import
pdb
# df = pd.read_csv(resources_dir+'yearly_metrics.csv')
# df['hourly_samples'] = [0] * len(df)
# df['capture'] = [0] * len(df)
df
=
pd
.
read_csv
(
resources_dir
+
'
intermediate_at_cap5500.csv
'
)
for
idx
,
row
in
df
.
iterrows
():
if
idx
>
5500
:
id_tuple
=
row
[
'
o3_series_id
'
]
id_string_list
=
[
str
(
id_
)
for
id_
in
eval
(
id_tuple
)]
query
=
f
"""
SELECT
datetime, value
FROM o3_hourly
WHERE id IN (
{
'
,
'
.
join
(
id_string_list
)
}
)
AND datetime between
'
2010-01-01 00:00:00
'
AND
'
2014-12-31 23:59:59
'
;
"""
result
=
query_db
(
query
)
result
.
drop_duplicates
(
subset
=
'
datetime
'
,
inplace
=
True
,
ignore_index
=
True
)
count
=
len
(
result
)
df
.
loc
[
idx
,
'
hourly_samples
'
]
=
count
df
.
loc
[
idx
,
'
capture
'
]
=
count
/
43824
print
(
count
,
count
/
43824
)
if
(
idx
>
1
)
and
(
idx
%
500
==
0
):
df
.
to_csv
(
resources_dir
+
f
'
intermediate_at_cap
{
idx
}
.csv
'
,
index
=
False
)
df
.
to_csv
(
resources_dir
+
f
'
yearly_metrics_cap.csv
'
,
index
=
False
)
pdb
.
set_trace
()
def
full_aqbench
():
def
full_aqbench
():
"""
"""
start one retrieval.
start one retrieval.
...
@@ -457,4 +495,5 @@ if __name__ == '__main__':
...
@@ -457,4 +495,5 @@ if __name__ == '__main__':
logging
.
StreamHandler
()])
logging
.
StreamHandler
()])
# start retrieval
# start retrieval
full_aqbench
()
# full_aqbench()
data_capture
()
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