From 10f4ebbab5b95b122a7c818458f8fbf63da3f903 Mon Sep 17 00:00:00 2001 From: ayushpatnaikgit Date: Wed, 26 Jun 2024 15:50:34 +0530 Subject: [PATCH 1/4] Update packages --- Project.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index a2f1603..e469324 100644 --- a/Project.toml +++ b/Project.toml @@ -28,18 +28,18 @@ CSV = "0.10.4" CubicSplines = "0.1.1, 0.2" DataFrames = "1.3.3" Dates = "1.7.0" -DimensionalData = "0.21" +DimensionalData = "0.27.3" Distributions = "0.25.53" GLM = "1.7.0" HypothesisTests = "0.10.9, 0.11" Images = "0.25.2" Plots = "1" -Rasters = "0.5" -Shapefile = "0.7.4, 0.8, 0.10, 0.12" +Rasters = "0.11" +Shapefile = "0.10, 0.12" SmoothingSplines = "0.3.1" Statistics = "1.7.0" StatsBase = "0.33.16, 0.34" -julia = "1" +julia = "1.10" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 9e10ee1808cd9db465312376b0b321152a04aa9a Mon Sep 17 00:00:00 2001 From: ayushpatnaikgit Date: Wed, 26 Jun 2024 10:49:51 +0000 Subject: [PATCH 2/4] export readnl --- src/NighttimeLights.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NighttimeLights.jl b/src/NighttimeLights.jl index 14ac5f0..75dbb69 100644 --- a/src/NighttimeLights.jl +++ b/src/NighttimeLights.jl @@ -3,7 +3,7 @@ module NighttimeLights using Rasters, DataFrames, Shapefile, StatsBase, SmoothingSplines, GLM, Distributions, HypothesisTests, Plots, Dates, DimensionalData, CubicSplines, SparseArrays, NCDatasets, ArchGDAL ## Utilities -export Raster, load_example, radiance_datacube, ncfobs_datacube, long_apply, apply_mask, mumbai_map, add_dim, annular_ring, centre_of_mass +export Raster, load_example, radiance_datacube, ncfobs_datacube, long_apply, apply_mask, mumbai_map, add_dim, annular_ring, centre_of_mass, readnl ## cleaning methods export bgnoise_PSTT2021, bias_PSTT2021, PSTT2021_conventional, PSTT2021, clean_complete, na_interp_linear, na_recode, outlier_variance, outlier_hampel, replace_negative From 1c9f969d9677a193de43b87eac0e0e6f81eb5eaf Mon Sep 17 00:00:00 2001 From: ayushpatnaikgit Date: Wed, 26 Jun 2024 10:50:07 +0000 Subject: [PATCH 3/4] Fix example and add geom type --- src/readnl.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/readnl.jl b/src/readnl.jl index c974b2d..6109da7 100644 --- a/src/readnl.jl +++ b/src/readnl.jl @@ -66,14 +66,14 @@ Two `RasterDataCube` instances. The first contains the cropped radiance data, an # Examples ```julia -using Geometries -geom = Geometries.read("path_to_your_shapefile.shp") # replace this with your actual shapefile +using Shapefile +geom = Shapefile.Table("path_to_your_shapefile.shp").geometry[1] # replace this with your actual shapefile start_date = Date(2015, 01) end_date = Date(2020, 12) rad_dc, cf_dc = readnl(geom, start_date, end_date) ``` """ -function readnl(geom, start_date = Date(2012, 04), end_date = Date(2023, 01); rad_path = "/mnt/giant-disk/nighttimelights/monthly/rad/", cf_path = "/mnt/giant-disk/nighttimelights/monthly/cf/") +function readnl(geom::Shapefile.Polygon, start_date = Date(2012, 04), end_date = Date(2023, 01); rad_path = "/mnt/giant-disk/nighttimelights/monthly/rad/", cf_path = "/mnt/giant-disk/nighttimelights/monthly/cf/") rad_files, sorted_dates = sort_files_by_date(rad_path, start_date, end_date) cf_files, sorted_dates = sort_files_by_date(cf_path, start_date, end_date) rad_raster_list = [crop(Raster(i, lazy = true), to = geom) for i in rad_path .* rad_files] From de319d21251411eb49d5d81cff0c835e0f465aac Mon Sep 17 00:00:00 2001 From: ayushpatnaikgit Date: Wed, 26 Jun 2024 11:06:30 +0000 Subject: [PATCH 4/4] Update codecov --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b396f36..f4a64c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,12 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest with: - version: '1.9' + version: '1.10' - name: Install test dependencies run: julia --project=test/ -e 'using Pkg; Pkg.instantiate()' - name: Run tests run: julia --project=. -e 'using Pkg; Pkg.test("NighttimeLights", coverage=true)' - name: Codecov - run: julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())' + env: + CODECOV_TOKEN: ${{ secrets.CODECOV }} + run: julia --project=. -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' \ No newline at end of file