Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
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
US191
Oceano2python
Commits
6971a118
Commit
6971a118
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
rename files and function following pep8 convention
parent
82602b2b
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
file_extractor.py
+4
-4
4 additions, 4 deletions
file_extractor.py
netcdf.py
+1
-1
1 addition, 1 deletion
netcdf.py
oceano.py
+2
-2
2 additions, 2 deletions
oceano.py
physical_parameter.py
+0
-0
0 additions, 0 deletions
physical_parameter.py
tests/test_roscop.py
+7
-7
7 additions, 7 deletions
tests/test_roscop.py
with
14 additions
and
14 deletions
file_extractor.py
+
4
−
4
View file @
6971a118
...
...
@@ -65,7 +65,7 @@ class FileExtractor:
return
buf
# first pass on file(s)
def
first
P
ass
(
self
):
def
first
_p
ass
(
self
):
'''
Returns
------
...
...
@@ -99,7 +99,7 @@ class FileExtractor:
# return self.n, self.m
# second pass, extract data from roscop code in fname and fill array
def
second
P
ass
(
self
,
cfg
,
device
):
def
second
_p
ass
(
self
,
cfg
,
device
):
'''
Read the file to its internal dict
...
...
@@ -188,8 +188,8 @@ if __name__ == "__main__":
fe
=
FileExtractor
(
args
.
fname
,
args
.
keys
)
print
(
"
File(s): {}, Config: {}
"
.
format
(
args
.
fname
,
args
.
config
))
cfg
=
toml
.
load
(
args
.
config
)
fe
.
first
P
ass
()
fe
.
first
_p
ass
()
print
(
"
Indices: {} x {}
\n
keys: {}
"
.
format
(
fe
.
n
,
fe
.
m
,
fe
.
keys
))
fe
.
second
P
ass
(
cfg
,
'
ctd
'
)
fe
.
second
_p
ass
(
cfg
,
'
ctd
'
)
# debug
# print(fe.disp())
This diff is collapsed.
Click to expand it.
netcdf.py
+
1
−
1
View file @
6971a118
import
logging
from
netCDF4
import
Dataset
from
numpy
import
arange
,
dtype
from
physical
P
arameter
import
Roscop
from
physical
_p
arameter
import
Roscop
def
writeNetCDF
(
fileName
,
fe
):
...
...
This diff is collapsed.
Click to expand it.
oceano.py
+
2
−
2
View file @
6971a118
...
...
@@ -128,9 +128,9 @@ def process(args, cfg, ti):
fe
=
FileExtractor
(
args
.
files
,
args
.
keys
)
# cfg = toml.load(args.config)
fe
.
first
P
ass
()
fe
.
first
_p
ass
()
# fe.secondPass(['PRES', 'TEMP', 'PSAL', 'DOX2'], cfg, 'ctd')
fe
.
second
P
ass
(
cfg
,
ti
)
fe
.
second
_p
ass
(
cfg
,
ti
)
# fe.disp(['PRES', 'TEMP', 'PSAL', 'DOX2'])
return
fe
...
...
This diff is collapsed.
Click to expand it.
physical
P
arameter.py
→
physical
_p
arameter.py
+
0
−
0
View file @
6971a118
File moved
This diff is collapsed.
Click to expand it.
tests/test_roscop.py
+
7
−
7
View file @
6971a118
import
unittest
from
physical
P
arameter
import
Roscop
from
physical
_p
arameter
import
Roscop
'''
Run test in single file
...
...
@@ -31,20 +31,20 @@ class testRoscop(unittest.TestCase):
def
test_key_TEMP
(
self
):
'''
test the standard_name for physical parameter TEMP
'''
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
TEMP
'
)
[
self
.
assertEqual
(
self
.
r
[
'
TEMP
'
]
[
'
standard_name
'
],
'
sea_water_temperature
'
)
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
TEMP
'
)
[
self
.
assertEqual
(
self
.
r
[
'
TEMP
'
]
[
'
units
'
],
'
degree_Celsius
'
)
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
TEMP
'
)
[
self
.
assertEqual
(
self
.
r
[
'
TEMP
'
]
[
'
comment
'
],
'
Ocean temperature in Degrees Celsius
'
)
def
test_key_PSAL
(
self
):
'''
test the standard_name for physical parameter PSAL
'''
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
PSAL
'
)
[
self
.
assertEqual
(
self
.
r
[
'
PSAL
'
]
[
'
standard_name
'
],
'
sea_water_salinity
'
)
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
PSAL
'
)
[
self
.
assertEqual
(
self
.
r
[
'
PSAL
'
]
[
'
conventions
'
],
'
PSU
'
)
self
.
assertEqual
(
self
.
r
.
returnCode
(
'
PSAL
'
)
[
self
.
assertEqual
(
self
.
r
[
'
PSAL
'
]
[
'
comment
'
],
'
Ocean practical salinity (PSS-78)
'
)
...
...
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