Skip to content

Commit c5fb73f

Browse files
Merge branch 'main' into SymbolOrString
2 parents e63b9d3 + ed5a70a commit c5fb73f

File tree

4 files changed

+75
-13
lines changed

4 files changed

+75
-13
lines changed

.github/workflows/IntegrationTest.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [main]
5+
tags: [v*]
6+
pull_request:
7+
8+
concurrency:
9+
# Skip intermediate builds: always.
10+
# Cancel intermediate builds: only if it is a pull request build.
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13+
14+
jobs:
15+
test:
16+
name: ${{ matrix.package.repo }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
julia-version: [1]
22+
os: [ubuntu-latest]
23+
package:
24+
- {user: Alexander-Barth, repo: NCDatasets.jl}
25+
- {user: JuliaGeo, repo: GRIBDatasets.jl}
26+
- {user: Alexander-Barth, repo: TIFFDatasets.jl}
27+
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: julia-actions/setup-julia@v1
31+
with:
32+
version: ${{ matrix.julia-version }}
33+
arch: x64
34+
- uses: julia-actions/julia-buildpkg@latest
35+
- name: Clone Downstream
36+
uses: actions/checkout@v2
37+
with:
38+
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
39+
path: downstream
40+
- name: Load this and run the downstream tests
41+
shell: julia --project=downstream {0}
42+
run: |
43+
using Pkg
44+
try
45+
# force it to use this PR's version of the package
46+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
47+
Pkg.update()
48+
Pkg.test() # resolver may fail with test time deps
49+
catch err
50+
err isa Pkg.Resolve.ResolverError || rethrow()
51+
# If we can't resolve that means this is incompatible by SemVer and this is fine
52+
# It means we marked this as a breaking change, so we don't need to worry about
53+
# Mistakenly introducing a breaking change, as we have intentionally made one
54+
55+
@info "Not compatible with this release. No problem." exception=err
56+
exit(0) # Exit immediately, as a success
57+
end

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ authors = ["Alexander Barth <[email protected]>"]
44
keywords = ["netcdf", "GRIB", "climate and forecast conventions", "oceanography", "meteorology", "climatology", "opendap"]
55
license = "MIT"
66
desc = "CommonDataModel is a module that defines types common to NetCDF and GRIB data"
7-
version = "0.2.2"
7+
version = "0.2.3"
88

99
[deps]
1010
CFTime = "179af706-886a-5703-950a-314cd64e0468"

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ close(ds)
3636

3737
As a proof-of-concept, there is also an [`TIFFDatasets`](https://github.com/Alexander-Barth/TIFFDatasets.jl) package for GeoTIFF files.
3838

39+
# File conversions
3940

41+
By implementing a common interface, GRIB files can be converted to NetCDF files using
42+
`NCDatasets.write`:
4043

44+
```julia
45+
using NCDatasets
46+
using GRIBDatasets
47+
using Downloads: download
4148

49+
grib_file = download("https://github.com/JuliaGeo/GRIBDatasets.jl/raw/98356af026ea39a5ec0b5e64e4289105492321f8/test/sample-data/era5-levels-members.grib")
50+
netcdf_file = "test.nc"
51+
NCDatasets.write(netcdf_file,GRIBDataset(grib_file))
52+
```

src/attribute.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,20 @@ function show_attrib(io,a)
4040
level = get(io, :level, 0)
4141
indent = " " ^ level
4242

43-
# if !isopen(ds)
44-
# print(io,"closed Dataset")
45-
# return
46-
# end
43+
# need to know ds from a
44+
#if !isopen(ds)
45+
# print(io,"Dataset attributes (file closed)")
46+
# return
47+
#end
4748

4849
try
49-
# use the same order of attributes than in the NetCDF file
50+
# use the same order of attributes than in the dataset
5051
for (attname,attval) in a
5152
print(io,indent,@sprintf("%-20s = ",attname))
5253
printstyled(io, @sprintf("%s",attval),color=attribute_color[])
5354
print(io,"\n")
5455
end
5556
catch err
5657
print(io,"Dataset attributes (file closed)")
57-
# if isa(err,NetCDFError)
58-
# if err.code == NC_EBADID
59-
# print(io,"Dataset attributes (file closed)")
60-
# return
61-
# end
62-
# end
63-
# rethrow()
6458
end
6559
end

0 commit comments

Comments
 (0)