Skip to content

Commit d62d48c

Browse files
committed
firstValue lastValue camelcase
1 parent ba60ce2 commit d62d48c

File tree

5 files changed

+114
-114
lines changed

5 files changed

+114
-114
lines changed

lib/bald/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -984,23 +984,23 @@ def _load_netcdf_group_vars(fhandle, agroup, root_container, baseuri, identity_p
984984
len(agroup.variables[name]) > 0):
985985

986986
if not isinstance(agroup.variables[name][0], np.ma.core.MaskedConstant):
987-
sattrs['bald__first_value'] = agroup.variables[name][0]
988-
if isinstance(sattrs['bald__first_value'], str):
987+
sattrs['bald__firstValue'] = agroup.variables[name][0]
988+
if isinstance(sattrs['bald__firstValue'], str):
989989
pass
990990

991-
elif np.issubdtype(sattrs['bald__first_value'].dtype, np.integer):
992-
sattrs['bald__first_value'] = int(sattrs['bald__first_value'])
993-
elif np.issubdtype(sattrs['bald__first_value'].dtype, np.floating):
994-
sattrs['bald__first_value'] = float(sattrs['bald__first_value'])
991+
elif np.issubdtype(sattrs['bald__firstValue'].dtype, np.integer):
992+
sattrs['bald__firstValue'] = int(sattrs['bald__firstValue'])
993+
elif np.issubdtype(sattrs['bald__firstValue'].dtype, np.floating):
994+
sattrs['bald__firstValue'] = float(sattrs['bald__firstValue'])
995995
if (len(agroup.variables[name]) > 1 and
996996
not isinstance(agroup.variables[name][-1], np.ma.core.MaskedConstant)):
997-
sattrs['bald__last_value'] = agroup.variables[name][-1]
998-
if isinstance(sattrs['bald__last_value'], str):
997+
sattrs['bald__lastValue'] = agroup.variables[name][-1]
998+
if isinstance(sattrs['bald__lastValue'], str):
999999
pass
1000-
elif np.issubdtype(sattrs['bald__last_value'].dtype, np.integer):
1001-
sattrs['bald__last_value'] = int(sattrs['bald__last_value'])
1002-
elif np.issubdtype(sattrs['bald__last_value'].dtype, np.floating):
1003-
sattrs['bald__last_value'] = float(sattrs['bald__last_value'])
1000+
elif np.issubdtype(sattrs['bald__lastValue'].dtype, np.integer):
1001+
sattrs['bald__lastValue'] = int(sattrs['bald__lastValue'])
1002+
elif np.issubdtype(sattrs['bald__lastValue'].dtype, np.floating):
1003+
sattrs['bald__lastValue'] = float(sattrs['bald__lastValue'])
10041004

10051005
# datetime special case
10061006
if 'units' in agroup.variables[name].ncattrs():
@@ -1033,7 +1033,7 @@ def _load_netcdf_group_vars(fhandle, agroup, root_container, baseuri, identity_p
10331033
quantity,
10341034
epoch=tog)
10351035
if first is not np.ma.masked:
1036-
sattrs['bald__first_value'] = edate_first
1036+
sattrs['bald__firstValue'] = edate_first
10371037
if len(agroup.variables[name]) > 1:
10381038
if agroup.variables[name][0] == fv:
10391039
last = np.ma.MaskedArray(agroup.variables[name][-1],
@@ -1049,7 +1049,7 @@ def _load_netcdf_group_vars(fhandle, agroup, root_container, baseuri, identity_p
10491049
quantity,
10501050
epoch=tog)
10511051

1052-
sattrs['bald__last_value'] = edate_last
1052+
sattrs['bald__lastValue'] = edate_last
10531053

10541054

10551055

lib/bald/tests/integration/TTL/GEMS_CO2_Apr2006.ttl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ this:co2 a bald:Array ;
3333
NetCDF:scale_factor 0.000981685145029486 ;
3434
NetCDF:units "kg kg**-1" ;
3535
bald:references [ a bald:Reference ;
36+
bald:target this:longitude ;
37+
bald:targetReshape ( 1 1 1 360 ) ;
38+
bald:targetShape ( 360 ) ],
39+
[ a bald:Reference ;
40+
bald:target this:levelist ;
41+
bald:targetReshape ( 1 60 1 1 ) ;
42+
bald:targetShape ( 60 ) ],
43+
[ a bald:Reference ;
3644
bald:target this:latitude ;
3745
bald:targetReshape ( 1 1 181 1 ) ;
3846
bald:targetShape ( 181 ) ],
3947
[ a bald:Reference ;
4048
bald:target this:time ;
4149
bald:targetReshape ( 1 1 1 1 ) ;
42-
bald:targetShape ( 1 ) ],
43-
[ a bald:Reference ;
44-
bald:target this:levelist ;
45-
bald:targetReshape ( 1 60 1 1 ) ;
46-
bald:targetShape ( 60 ) ],
47-
[ a bald:Reference ;
48-
bald:target this:longitude ;
49-
bald:targetReshape ( 1 1 1 360 ) ;
50-
bald:targetShape ( 360 ) ] ;
50+
bald:targetShape ( 1 ) ] ;
5151
bald:shape ( 1 60 181 360 ) .
5252

5353
this:lnsp a bald:Array ;
@@ -56,46 +56,46 @@ this:lnsp a bald:Array ;
5656
NetCDF:add_offset 11.2087164280841 ;
5757
NetCDF:long_name "Logarithm of surface pressure" ;
5858
bald:references [ a bald:Reference ;
59+
bald:target this:time ;
60+
bald:targetReshape ( 1 1 1 1 ) ;
61+
bald:targetShape ( 1 ) ],
62+
[ a bald:Reference ;
63+
bald:target this:levelist ;
64+
bald:targetReshape ( 1 60 1 1 ) ;
65+
bald:targetShape ( 60 ) ],
66+
[ a bald:Reference ;
5967
bald:target this:latitude ;
6068
bald:targetReshape ( 1 1 181 1 ) ;
6169
bald:targetShape ( 181 ) ],
6270
[ a bald:Reference ;
6371
bald:target this:longitude ;
6472
bald:targetReshape ( 1 1 1 360 ) ;
65-
bald:targetShape ( 360 ) ],
66-
[ a bald:Reference ;
67-
bald:target this:levelist ;
68-
bald:targetReshape ( 1 60 1 1 ) ;
69-
bald:targetShape ( 60 ) ],
70-
[ a bald:Reference ;
71-
bald:target this:time ;
72-
bald:targetReshape ( 1 1 1 1 ) ;
73-
bald:targetShape ( 1 ) ] ;
73+
bald:targetShape ( 360 ) ] ;
7474
bald:shape ( 1 60 181 360 ) .
7575

7676
this:latitude a bald:Array ;
7777
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/latitude/> ;
7878
NetCDF:units "degrees_north" ;
79-
bald:first_value 90.0 ;
80-
bald:last_value -90.0 ;
79+
bald:firstValue 90.0 ;
80+
bald:lastValue -90.0 ;
8181
bald:shape ( 181 ) .
8282

8383
this:levelist a bald:Array ;
8484
NetCDF:long_name "model_level_number" ;
85-
bald:first_value 1 ;
86-
bald:last_value 60 ;
85+
bald:firstValue 1 ;
86+
bald:lastValue 60 ;
8787
bald:shape ( 60 ) .
8888

8989
this:longitude a bald:Array ;
9090
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/longitude/> ;
9191
NetCDF:units "degrees_east" ;
92-
bald:first_value 0.0 ;
93-
bald:last_value 359.0 ;
92+
bald:firstValue 0.0 ;
93+
bald:lastValue 359.0 ;
9494
bald:shape ( 360 ) .
9595

9696
this:time a bald:Array ;
9797
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/time/> ;
9898
NetCDF:units "hours since 1900-01-01 00:00:0.0" ;
99-
bald:first_value "2006-04-01T00:00:00"^^xsd:dateTime ;
99+
bald:firstValue "2006-04-01T00:00:00"^^xsd:dateTime ;
100100
bald:shape ( 1 ) .
101101

lib/bald/tests/integration/TTL/ereefs_gbr4_ncld.ttl

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ this:eta a bald:Array ;
6464
NetCDF:units "metre" ;
6565
NetCDF:valid_range ( -10.0 10.0 ) ;
6666
bald:references [ a bald:Reference ;
67-
bald:target this:time ;
68-
bald:targetReshape ( 5 1 1 ) ;
69-
bald:targetShape ( 5 ) ],
67+
bald:target this:longitude ;
68+
bald:targetReshape ( 1 180 600 ) ;
69+
bald:targetShape ( 180 600 ) ],
7070
[ a bald:Reference ;
7171
bald:target this:latitude ;
7272
bald:targetReshape ( 1 180 600 ) ;
7373
bald:targetShape ( 180 600 ) ],
7474
[ a bald:Reference ;
75-
bald:target this:longitude ;
76-
bald:targetReshape ( 1 180 600 ) ;
77-
bald:targetShape ( 180 600 ) ] ;
75+
bald:target this:time ;
76+
bald:targetReshape ( 5 1 1 ) ;
77+
bald:targetShape ( 5 ) ] ;
7878
bald:shape ( 5 180 600 ) .
7979

8080
this:salt a bald:Array ;
@@ -90,19 +90,19 @@ this:salt a bald:Array ;
9090
NetCDF:long_name "Salinity" ;
9191
NetCDF:units "PSU" ;
9292
bald:references [ a bald:Reference ;
93-
bald:target this:latitude ;
93+
bald:target this:longitude ;
9494
bald:targetReshape ( 1 1 180 600 ) ;
9595
bald:targetShape ( 180 600 ) ],
96-
[ a bald:Reference ;
97-
bald:target this:zc ;
98-
bald:targetReshape ( 1 47 1 1 ) ;
99-
bald:targetShape ( 47 ) ],
10096
[ a bald:Reference ;
10197
bald:target this:time ;
10298
bald:targetReshape ( 5 1 1 1 ) ;
10399
bald:targetShape ( 5 ) ],
104100
[ a bald:Reference ;
105-
bald:target this:longitude ;
101+
bald:target this:zc ;
102+
bald:targetReshape ( 1 47 1 1 ) ;
103+
bald:targetShape ( 47 ) ],
104+
[ a bald:Reference ;
105+
bald:target this:latitude ;
106106
bald:targetReshape ( 1 1 180 600 ) ;
107107
bald:targetShape ( 180 600 ) ] ;
108108
bald:shape ( 5 47 180 600 ) .
@@ -124,18 +124,18 @@ this:temp a bald:Array ;
124124
bald:target this:time ;
125125
bald:targetReshape ( 5 1 1 1 ) ;
126126
bald:targetShape ( 5 ) ],
127-
[ a bald:Reference ;
128-
bald:target this:zc ;
129-
bald:targetReshape ( 1 47 1 1 ) ;
130-
bald:targetShape ( 47 ) ],
131127
[ a bald:Reference ;
132128
bald:target this:longitude ;
133129
bald:targetReshape ( 1 1 180 600 ) ;
134130
bald:targetShape ( 180 600 ) ],
135131
[ a bald:Reference ;
136132
bald:target this:latitude ;
137133
bald:targetReshape ( 1 1 180 600 ) ;
138-
bald:targetShape ( 180 600 ) ] ;
134+
bald:targetShape ( 180 600 ) ],
135+
[ a bald:Reference ;
136+
bald:target this:zc ;
137+
bald:targetReshape ( 1 47 1 1 ) ;
138+
bald:targetShape ( 47 ) ] ;
139139
bald:shape ( 5 47 180 600 ) .
140140

141141
this:u a bald:Array ;
@@ -155,9 +155,9 @@ this:u a bald:Array ;
155155
NetCDF:units "ms-1" ;
156156
NetCDF:valid_range ( -100.0 100.0 ) ;
157157
bald:references [ a bald:Reference ;
158-
bald:target this:longitude ;
159-
bald:targetReshape ( 1 1 180 600 ) ;
160-
bald:targetShape ( 180 600 ) ],
158+
bald:target this:zc ;
159+
bald:targetReshape ( 1 47 1 1 ) ;
160+
bald:targetShape ( 47 ) ],
161161
[ a bald:Reference ;
162162
bald:target this:latitude ;
163163
bald:targetReshape ( 1 1 180 600 ) ;
@@ -167,9 +167,9 @@ this:u a bald:Array ;
167167
bald:targetReshape ( 5 1 1 1 ) ;
168168
bald:targetShape ( 5 ) ],
169169
[ a bald:Reference ;
170-
bald:target this:zc ;
171-
bald:targetReshape ( 1 47 1 1 ) ;
172-
bald:targetShape ( 47 ) ] ;
170+
bald:target this:longitude ;
171+
bald:targetReshape ( 1 1 180 600 ) ;
172+
bald:targetShape ( 180 600 ) ] ;
173173
bald:shape ( 5 47 180 600 ) .
174174

175175
this:v a bald:Array ;
@@ -189,21 +189,21 @@ this:v a bald:Array ;
189189
NetCDF:units "ms-1" ;
190190
NetCDF:valid_range ( -100.0 100.0 ) ;
191191
bald:references [ a bald:Reference ;
192+
bald:target this:zc ;
193+
bald:targetReshape ( 1 47 1 1 ) ;
194+
bald:targetShape ( 47 ) ],
195+
[ a bald:Reference ;
196+
bald:target this:longitude ;
197+
bald:targetReshape ( 1 1 180 600 ) ;
198+
bald:targetShape ( 180 600 ) ],
199+
[ a bald:Reference ;
192200
bald:target this:time ;
193201
bald:targetReshape ( 5 1 1 1 ) ;
194202
bald:targetShape ( 5 ) ],
195203
[ a bald:Reference ;
196204
bald:target this:latitude ;
197205
bald:targetReshape ( 1 1 180 600 ) ;
198-
bald:targetShape ( 180 600 ) ],
199-
[ a bald:Reference ;
200-
bald:target this:longitude ;
201-
bald:targetReshape ( 1 1 180 600 ) ;
202-
bald:targetShape ( 180 600 ) ],
203-
[ a bald:Reference ;
204-
bald:target this:zc ;
205-
bald:targetReshape ( 1 47 1 1 ) ;
206-
bald:targetShape ( 47 ) ] ;
206+
bald:targetShape ( 180 600 ) ] ;
207207
bald:shape ( 5 47 180 600 ) .
208208

209209
this:wspeed_u a bald:Array ;
@@ -215,13 +215,13 @@ this:wspeed_u a bald:Array ;
215215
NetCDF:units "ms-1" ;
216216
NetCDF:valid_range ( -1000.0 1000.0 ) ;
217217
bald:references [ a bald:Reference ;
218-
bald:target this:time ;
219-
bald:targetReshape ( 5 1 1 ) ;
220-
bald:targetShape ( 5 ) ],
221-
[ a bald:Reference ;
222218
bald:target this:longitude ;
223219
bald:targetReshape ( 1 180 600 ) ;
224220
bald:targetShape ( 180 600 ) ],
221+
[ a bald:Reference ;
222+
bald:target this:time ;
223+
bald:targetReshape ( 5 1 1 ) ;
224+
bald:targetShape ( 5 ) ],
225225
[ a bald:Reference ;
226226
bald:target this:latitude ;
227227
bald:targetReshape ( 1 180 600 ) ;
@@ -241,11 +241,11 @@ this:wspeed_v a bald:Array ;
241241
bald:targetReshape ( 5 1 1 ) ;
242242
bald:targetShape ( 5 ) ],
243243
[ a bald:Reference ;
244-
bald:target this:latitude ;
244+
bald:target this:longitude ;
245245
bald:targetReshape ( 1 180 600 ) ;
246246
bald:targetShape ( 180 600 ) ],
247247
[ a bald:Reference ;
248-
bald:target this:longitude ;
248+
bald:target this:latitude ;
249249
bald:targetReshape ( 1 180 600 ) ;
250250
bald:targetShape ( 180 600 ) ] ;
251251
bald:shape ( 5 180 600 ) .

lib/bald/tests/integration/TTL/group_array_geo.ttl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ this__vector_quantities__wind:u_wind a bald:Array ;
7070
nc:units "m s-1" ;
7171
georef:domain this:u_points ;
7272
bald:references [ a bald:Reference ;
73-
bald:target this:time ;
74-
bald:targetReshape ( 4 1 1 ) ;
75-
bald:targetShape ( 4 ) ],
76-
[ a bald:Reference ;
7773
bald:target this:y_t ;
7874
bald:targetReshape ( 1 91 1 ) ;
7975
bald:targetShape ( 91 ) ],
8076
[ a bald:Reference ;
8177
bald:target this:x_q ;
8278
bald:targetReshape ( 1 1 144 ) ;
83-
bald:targetShape ( 144 ) ] ;
79+
bald:targetShape ( 144 ) ],
80+
[ a bald:Reference ;
81+
bald:target this:time ;
82+
bald:targetReshape ( 4 1 1 ) ;
83+
bald:targetShape ( 4 ) ] ;
8484
bald:shape ( 4 91 144 ) .
8585

8686
this__vector_quantities__wind:v_wind a bald:Array ;
@@ -122,34 +122,34 @@ this:v_points a bald:Resource ;
122122
this:x_q a bald:Array ;
123123
cf:standard_name <http://vocab.nerc.ac.uk/standard_name/longitude/> ;
124124
nc:units "degrees" ;
125-
bald:first_value 1.25 ;
126-
bald:last_value 358.75 ;
125+
bald:firstValue 1.25 ;
126+
bald:lastValue 358.75 ;
127127
bald:shape ( 144 ) .
128128

129129
this:y_q a bald:Array ;
130130
cf:standard_name <http://vocab.nerc.ac.uk/standard_name/latitude/> ;
131131
nc:units "degrees" ;
132-
bald:first_value -89.0 ;
133-
bald:last_value 89.0 ;
132+
bald:firstValue -89.0 ;
133+
bald:lastValue 89.0 ;
134134
bald:shape ( 90 ) .
135135

136136
this:time a bald:Array ;
137137
rdfs:label "Time" ;
138-
bald:first_value "2020-05-05T00:00Z" ;
139-
bald:last_value "2020-05-05T18:00Z" ;
138+
bald:firstValue "2020-05-05T00:00Z" ;
139+
bald:lastValue "2020-05-05T18:00Z" ;
140140
bald:shape ( 4 ) .
141141

142142
this:x_t a bald:Array ;
143143
cf:standard_name <http://vocab.nerc.ac.uk/standard_name/longitude/> ;
144144
nc:units "degrees" ;
145-
bald:first_value 0.0 ;
146-
bald:last_value 357.5 ;
145+
bald:firstValue 0.0 ;
146+
bald:lastValue 357.5 ;
147147
bald:shape ( 144 ) .
148148

149149
this:y_t a bald:Array ;
150150
cf:standard_name <http://vocab.nerc.ac.uk/standard_name/latitude/> ;
151151
nc:units "degrees" ;
152-
bald:first_value -90.0 ;
153-
bald:last_value 90.0 ;
152+
bald:firstValue -90.0 ;
153+
bald:lastValue 90.0 ;
154154
bald:shape ( 91 ) .
155155

0 commit comments

Comments
 (0)