Skip to content

Commit ba9a735

Browse files
authored
Merge pull request #26 from lupemba/issue-25-replace-int-with-Integer
Add windows disclaimer and change int to Integer.
2 parents 85f797e + a63c3e8 commit ba9a735

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,6 @@ end
119119
```
120120
## Opening issues:
121121
GRIB format files may have a (very) large amount of different shapes. `GRIBDatasets` might not work for your specific edge case. If this happens, please open an issue, if possible providing the file triggering the bug.
122+
123+
## Windows support is experimental
124+
The windows support is still under development. Most test cases works on windows but a few still fail. See issue GRIB.jl for more information https://github.com/weech/GRIB.jl/issues/14

src/messages.jl

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ const GRIB_STEP_UNITS_TO_SECONDS = [
2424

2525

2626
"""
27-
from_grib_date_time(date::Int, time::Int; epoch::DateTime=DEFAULT_EPOCH)
27+
from_grib_date_time(date::Integer, time::Integer; epoch::DateTime=DEFAULT_EPOCH)
2828
Seconds from epoch to the given date and time.
2929
"""
30-
function from_grib_date_time(date::Int, time::Int; epoch::DateTime=DEFAULT_EPOCH)::Int
30+
function from_grib_date_time(date::Integer, time::Integer; epoch::DateTime=DEFAULT_EPOCH)::Integer
3131
hour = time ÷ 100
3232
minute = time % 100
3333
year = date ÷ 10000
@@ -58,7 +58,7 @@ end
5858
from_grib_step(message::GRIB.Message, step_key::String="endStep", step_unit_key::String="stepUnits")
5959
Returns the `step_key` value in hours.
6060
"""
61-
function from_grib_step(message::GRIB.Message, step_key::String="endStep", step_unit_key::String="stepUnits")::Float64
61+
function from_grib_step(message::GRIB.Message, step_key::AbstractString="endStep", step_unit_key::AbstractString="stepUnits")::Float64
6262
to_seconds = GRIB_STEP_UNITS_TO_SECONDS[message[step_unit_key] + 1]
6363
return message[step_key] * to_seconds / 3600.0
6464
end
@@ -72,7 +72,7 @@ end
7272
Returns the integer seconds from the epoch to the verifying month value in the
7373
GRIB message.
7474
"""
75-
function from_grib_month(message::GRIB.Message, verifying_month_key::String="verifyingMonth", epoch::DateTime=DEFAULT_EPOCH)::Union{Int,Missing}
75+
function from_grib_month(message::GRIB.Message, verifying_month_key::AbstractString="verifyingMonth", epoch::DateTime=DEFAULT_EPOCH)::Union{Int,Missing}
7676
if !haskey(message, verifying_month_key)
7777
return missing
7878
end
@@ -96,7 +96,7 @@ julia> GDS.build_valid_time(10, 10)
9696
((), 36010)
9797
```
9898
"""
99-
function build_valid_time(time::Int, step::Int)::Tuple{Tuple{},Int64}
99+
function build_valid_time(time::Integer, step::Integer)::Tuple{Tuple{},Int64}
100100
step_s = step * 3600
101101

102102
data = time + step_s
@@ -111,7 +111,7 @@ julia> GDS.build_valid_time([10], 10)
111111
(("time",), [36010])
112112
```
113113
"""
114-
function build_valid_time(time::Array{Int,1}, step::Int)::Tuple{Tuple{String},Array{Int64,1}}
114+
function build_valid_time(time::Array{<:Integer,1}, step::Integer)::Tuple{Tuple{String},Array{Int64,1}}
115115
step_s = step * 3600
116116

117117
data = time .+ step_s
@@ -126,7 +126,7 @@ julia> GDS.build_valid_time(1, [10])
126126
(("step",), [36001])
127127
```
128128
"""
129-
function build_valid_time(time::Int, step::Array{Int,1})::Tuple{Tuple{String},Array{Int64,1}}
129+
function build_valid_time(time::Integer, step::Array{<:Integer,1})::Tuple{Tuple{String},Array{Int64,1}}
130130
step_s = step * 3600
131131

132132
data = time .+ step_s
@@ -146,7 +146,7 @@ julia> GDS.build_valid_time([10], [10])
146146
((), 36010)
147147
```
148148
"""
149-
function build_valid_time(time::Array{Int,1}, step::Array{Int,1})
149+
function build_valid_time(time::Array{<:Integer,1}, step::Array{<:Integer,1})
150150
step_s = step * 3600
151151

152152
if length(time) == 1 && length(step) == 1
@@ -215,7 +215,7 @@ Read a specific key from a GRIB.jl message. Attempts to convert the raw value
215215
associated with that key using the [`COMPUTED_KEYS`](@ref COMPUTED_KEYS) mapping
216216
to `from_grib_*` functions.
217217
"""
218-
function read_message(message::GRIB.Message, key::String)
218+
function read_message(message::GRIB.Message, key::AbstractString)
219219
value = missing
220220

221221
if key in keys(COMPUTED_KEYS)

0 commit comments

Comments
 (0)