Skip to content

Commit aabb2e2

Browse files
committed
preserve float precision
1 parent 6eb1391 commit aabb2e2

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

lib/bald/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def rdfnode(self, graph):
610610
elif terra_imp and isinstance(rdfobj, datetime.EpochDateTimes):
611611
rdfobj = rdflib.Literal(str(rdfobj), datatype=rdflib.XSD.dateTime)
612612
elif isinstance(rdfobj, float):
613-
rdfobj = rdflib.Literal(rdfobj, datatype=rdflib.XSD.decimal)
613+
rdfobj = rdflib.Literal(float(rdfobj), datatype=rdflib.XSD.decimal)
614614
else:
615615
rdfobj = rdflib.Literal(rdfobj)
616616
rdfpred = rdflib.URIRef(rdfpred)

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,45 +28,45 @@ this:co2 a bald:Array ;
2828
CFTerms:missing_value "-32767" ;
2929
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/mass_fraction_of_carbon_dioxide_in_air/> ;
3030
NetCDF:FillValue "-32767" ;
31-
NetCDF:add_offset 403.19221938 ;
31+
NetCDF:add_offset 403.192219379918 ;
3232
NetCDF:long_name "Carbon Dioxide" ;
33-
NetCDF:scale_factor 0.000981685145029 ;
33+
NetCDF:scale_factor 0.000981685145029486 ;
3434
NetCDF:units "kg kg**-1" ;
3535
bald:references [ a bald:Reference ;
36+
bald:target this:levelist ;
37+
bald:targetReshape ( 1 60 1 1 ) ;
38+
bald:targetShape ( 60 ) ],
39+
[ a bald:Reference ;
40+
bald:target this:time ;
41+
bald:targetReshape ( 1 1 1 1 ) ;
42+
bald:targetShape ( 1 ) ],
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:longitude ;
4149
bald:targetReshape ( 1 1 1 360 ) ;
42-
bald:targetShape ( 360 ) ],
43-
[ a bald:Reference ;
44-
bald:target this:time ;
45-
bald:targetReshape ( 1 1 1 1 ) ;
46-
bald:targetShape ( 1 ) ],
47-
[ a bald:Reference ;
48-
bald:target this:levelist ;
49-
bald:targetReshape ( 1 60 1 1 ) ;
50-
bald:targetShape ( 60 ) ] ;
50+
bald:targetShape ( 360 ) ] ;
5151
bald:shape ( 1 60 181 360 ) .
5252

5353
this:lnsp a bald:Array ;
5454
CFTerms:missing_value "-32767" ;
5555
NetCDF:FillValue "-32767" ;
56-
NetCDF:add_offset 11.2087164281 ;
56+
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 ;
5963
bald:target this:levelist ;
6064
bald:targetReshape ( 1 60 1 1 ) ;
6165
bald:targetShape ( 60 ) ],
6266
[ a bald:Reference ;
6367
bald:target this:longitude ;
6468
bald:targetReshape ( 1 1 1 360 ) ;
6569
bald:targetShape ( 360 ) ],
66-
[ a bald:Reference ;
67-
bald:target this:time ;
68-
bald:targetReshape ( 1 1 1 1 ) ;
69-
bald:targetShape ( 1 ) ],
7070
[ a bald:Reference ;
7171
bald:target this:latitude ;
7272
bald:targetReshape ( 1 1 181 1 ) ;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ this:votemper_pdf a bald:Array ;
8585
bald:target this:percentiles ;
8686
bald:targetReshape ( 19 1 1 1 1 ) ;
8787
bald:targetShape ( 19 ) ],
88-
[ a bald:Reference ;
89-
bald:target this:time ;
90-
bald:targetReshape ( 1 4 1 1 1 ) ;
91-
bald:targetShape ( 4 ) ],
9288
[ a bald:Reference ;
9389
bald:target this:deptht ;
9490
bald:targetReshape ( 1 1 4 1 1 ) ;
91+
bald:targetShape ( 4 ) ],
92+
[ a bald:Reference ;
93+
bald:target this:time ;
94+
bald:targetReshape ( 1 4 1 1 1 ) ;
9595
bald:targetShape ( 4 ) ] ;
9696
bald:shape ( 19 4 4 148 180 ) .
9797

0 commit comments

Comments
 (0)