Skip to content

Commit

Permalink
Rename package (#274)
Browse files Browse the repository at this point in the history
* Rename package

* Make sure to require latest YAXArrays
  • Loading branch information
meggart authored Apr 26, 2022
1 parent b299cba commit 1242fd2
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "ESDL"
name = "EarthDataLab"
uuid = "359177bc-a543-11e8-11b7-bb015dba3358"
authors = ["Fabian Gans <[email protected]>"]
version = "0.9.2"
Expand Down Expand Up @@ -36,7 +36,7 @@ Shapefile = "0.6, 0.7"
StatsBase = "0.32, 0.33"
Tables = "0.2, 1.0"
WeightedOnlineStats = "0.5"
YAXArrays = "0.2"
YAXArrays = "0.2.1"
Zarr = "0.6.2, 0.7"
julia = "1.3"

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# ESDL.jl
# EarthDataLab.jl

*Julia Package for the Earth System Data Cube*

| **Documentation** | **Build Status** |
|:-------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------:|
| [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliadatacubes.github.io/ESDL.jl/latest/) | [![][ci-img]][ci-url] [![codecov][codecov-img]](https://codecov.io/github/esa-esdl/ESDL.jl?branch=master) |
| [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://juliadatacubes.github.io/EarthDataLab.jl/latest/) | [![][ci-img]][ci-url] [![codecov][codecov-img]](https://codecov.io/github/esa-EarthDataLab/EarthDataLab.jl?branch=master) |

[codecov-img]: https://img.shields.io/codecov/c/github/esa-esdl/ESDL.jl/master.svg?label=codecov
[codecov-img]: https://img.shields.io/codecov/c/github/esa-EarthDataLab/EarthDataLab.jl/master.svg?label=codecov
# Installation

- Add the ESDL package
`Pkg.add(PackageSpec(url="https://github.com/esa-esdl/ESDL.jl"))`
- Add the EarthDataLab package
`Pkg.add(PackageSpec(url="https://github.com/juliadatacubes/EarthDataLab.jl"))`

# Documentation

The Documentation is available [here](https://juliadatacubes.github.io/ESDL.jl/latest/).
The Documentation is available [here](https://juliadatacubes.github.io/EarthDataLab.jl/latest/).

[ci-img]: https://github.com/esa-esdl/ESDL.jl/workflows/CI/badge.svg
[ci-url]: https://github.com/esa-esdl/ESDL.jl/actions?query=workflow%3ACI
[ci-img]: https://github.com/juliadatacubes/EarthDataLab.jl/workflows/CI/badge.svg
[ci-url]: https://github.com/juliadatacubes/EarthDataLab.jl/actions?query=workflow%3ACI
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Documenter, ESDL
using Documenter, EarthDataLab

makedocs(
modules = [ESDL],
modules = [EarthDataLab],
clean = true,
doctest = false,
format = Documenter.HTML(),
sitename = "ESDL.jl",
sitename = "EarthDataLab.jl",
authors = "Fabian Gans",
pages = [
"Home" => "index.md",
Expand All @@ -24,6 +24,6 @@ makedocs(
)

deploydocs(
repo = "github.com/JuliaDataCubes/ESDL.jl.git",
repo = "github.com/JuliaDataCubes/EarthDataLab.jl.git",
push_preview = true
)
28 changes: 14 additions & 14 deletions docs/src/API/analysis.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Analysis

The ESDL package comes with a list of predefined methods for statistical analysis.
The EarthDataLab package comes with a list of predefined methods for statistical analysis.
The functions are defined to work on specific axes. For example a function that removes the
mean annual cycle, will always extract one time series after the other from a cube, process them, store the results and concatenate the resulting time series to a new output cube. It does not matter which other axes are defined
in the input cube, the function will simply iterate over these.
Expand All @@ -19,19 +19,19 @@ that might be of interest to a broader community, please feel free to open a pul
All of these functions take a data cube as an argument, process the **input axis** and replace it with the **output axis**.

```docs
ESDL.Proc.removeMSC
ESDL.Proc.gapFillMSC
ESDL.Proc.gapfillpoly!
ESDL.Proc.getMSC
ESDL.Proc.getMedSC
EarthDataLab.Proc.removeMSC
EarthDataLab.Proc.gapFillMSC
EarthDataLab.Proc.gapfillpoly!
EarthDataLab.Proc.getMSC
EarthDataLab.Proc.getMedSC
```

### Time series decomposition

This function takes a data cube as an argument. It adds an additional dimension to the cube and returns it. Every variable, time step and location will have a set of four values in the new dimension instead of just one.

```docs
ESDL.Proc.filterTSFFT
EarthDataLab.Proc.filterTSFFT
```

## Simple Statistics
Expand All @@ -54,8 +54,8 @@ call one of the [(Weighted-)OnlineStats](@ref) methods.
An additional simple statistic function is:

```@docs
ESDL.Proc.normalizeTS
ESDL.Proc.quantile
EarthDataLab.Proc.normalizeTS
EarthDataLab.Proc.quantile
```

## (Weighted-)OnlineStats
Expand Down Expand Up @@ -166,7 +166,7 @@ In order to understand how these principles are applied, let us walk through a v
2. So the function will have to accept two arguments, which will be called `xin` for the input time series and `xout` for the output time series. Such a function can be defined like this:

```julia
using ESDL
using EarthDataLab

function mynorm(xout, xin)

Expand Down Expand Up @@ -302,13 +302,13 @@ In some cases one needs to have access to the value of an axis. For example when
are important to determine grid cell weights. To do this, one can pass a cube axis to mapCube as if it was a cube having only one dimension. The values will then correspond to the axis values (the latitudes in degrees in this case).

```julia
using ESDL # hide
using EarthDataLab # hide
function spatialAggregation(xout::Array{T,0}, xin::Matrix, latitudes::AbstractVector) where T
#code goes here
end

#Extract the latitude axis
latitudecube = ESDL.getAxis("Lat",cube)
latitudecube = EarthDataLab.getAxis("Lat",cube)

indims_map = InDims(LonAxis, LatAxis)
indims_lat = InDims(LatAxis)
Expand Down Expand Up @@ -345,7 +345,7 @@ So far in our examples we always re-used axes from the input cube as output cube
So for each pixel we want to do the polynomial regression on the two variables and then return a vector of coefficients. We define the function that does the calculation as:

```julia
using ESDL
using EarthDataLab
using Polynomials
function fit_npoly(xout, var1, var2, n)
p = polyfit(var1, var2, n)
Expand Down Expand Up @@ -409,4 +409,4 @@ Total size: 320.0 bytes
```


This is exactly the way the built-in functions in [Analysis](@ref) were generated. So in case you want to contribute some functionality that you feel would benefit this package, please open a pull request at https://github.com/esa-esdl/ESDL.jl
This is exactly the way the built-in functions in [Analysis](@ref) were generated. So in case you want to contribute some functionality that you feel would benefit this package, please open a pull request at https://github.com/juliadatacubes/EarthDataLab.jl
12 changes: 6 additions & 6 deletions docs/src/API/cube_access.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Before one can read data from a cube, it has to be opened. To open a data cube
which is accesible through the file system, use the `Cube` constructor:

```julia
using ESDL
using EarthDataLab
c = Cube("/patch/to/cube")
```
```
ESDL data cube at /Net/Groups/BGI/scratch/DataCube/v0.2.0/high-res/
EarthDataLab data cube at /Net/Groups/BGI/scratch/DataCube/v0.2.0/high-res/
Spatial resolution: 4320x2160 at 0.083333 degrees.
Temporal resolution: 2001-01-01T00:00:00 to 2012-01-01T00:00:00 at 8daily time steps
Variables: aerosol_optical_thickness_1610 aerosol_optical_thickness_550 aerosol_optical_thickness_555 aerosol_optical_thickness_659 aerosol_optical_thickness_865 air_temperature_2m bare_soil_evaporation black_sky_albedo burnt_area c_emissions country_mask evaporation evaporative_stress fractional_snow_cover gross_primary_productivity interception_loss land_surface_temperature latent_energy net_ecosystem_exchange open_water_evaporation ozone potential_evaporation precipitation root_moisture sensible_heat snow_sublimation snow_water_equivalent soil_moisture surface_moisture terrestrial_ecosystem_respiration transpiration water_mask water_vapour white_sky_albedo
Expand All @@ -21,7 +21,7 @@ This returns a `Cube` object that contains some basics information about the cub
## Getting a data handle

```julia
using ESDL
using EarthDataLab
c=Cube()
```

Expand Down Expand Up @@ -50,7 +50,7 @@ needed for the analysis. One can extract such a list by first creating a cube vi
containing all the needed variables and then apply the `extractLonLats` function.

```@docs
ESDL.Proc.extractLonLats
EarthDataLab.Proc.extractLonLats
```

Here is an example how to apply the function:
Expand All @@ -71,7 +71,7 @@ The returned type will depend on the size of the returned cube. If it is small e

## Cube Dimensions

Dimensions are an essential part of each Cube in ESDL. Every dimension that a cube has is associated
Dimensions are an essential part of each Cube in EarthDataLab. Every dimension that a cube has is associated
with an axis that stores the values of the dimension. For example, a `LatAxis` will contain a
field `values` representing the chosen latitudes. Similarly, a `VariableAxis` will contain a list of
Variable names. Axes types are divided in categorical axes and axes represented by ranges. All of them
Expand All @@ -80,5 +80,5 @@ are subtypes of the abstract type `CubeAxis`.
## List of known regions

```@docs
ESDL.known_regions
EarthDataLab.known_regions
```
2 changes: 1 addition & 1 deletion docs/src/API/iotools.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Loading and saving results

ESDL.ESDLTools.@loadOrGenerate
EarthDataLab.EarthDataLabTools.@loadOrGenerate
4 changes: 2 additions & 2 deletions docs/src/examples/distributed.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ addprocs(2)

@everywhere using Pkg
@everywhere Pkg.activate(".")
@everywhere using ESDL
@everywhere using EarthDataLab
@everywhere using Statistics

@everywhere function mymean(output, pixel)
Expand Down Expand Up @@ -45,7 +45,7 @@ addprocs(SlurmManager(10))

@everywhere using Pkg
@everywhere Pkg.activate(".")
@everywhere using ESDL
@everywhere using EarthDataLab
@everywhere using Statistics

inpath="zg1000_AERday_CanESM5_esm-hist_r6i1p1f1_gn_18500101-20141231.nc"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/time_mean.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## How to calculate a time mean

````@jldoctest
using ESDL
using EarthDataLab
c = Cube()
citaly = c[var = ["air_temperature_2m", "evaporation"], region="Italy", time=2001:2003]
mapslices(mean ∘ skipmissing, c, dims="Time")
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ESDL.jl
# EarthDataLab.jl

*A package to explore and analyze the Earth System Data Cube*

Expand All @@ -13,7 +13,7 @@ for more information.

## Example Jupyter Notebooks

You can find some example Jupyter Notebooks using *ESDL.jl* [here](https://github.com/esa-esdl/esdl-shared/tree/master/notebooks)
You can find some example Jupyter Notebooks using *ESDL.jl* [here](https://github.com/juliadatacubes/esdl-shared/tree/master/notebooks)

## Manual Outline

Expand Down
6 changes: 3 additions & 3 deletions src/ESDLTools.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module ESDLTools
using Distributed
import ..ESDL: ESDLdir
import ..EarthDataLab: ESDLdir
export freshworkermodule, passobj, @everywhereelsem,
@loadOrGenerate, PickAxisArray
struct PickAxisArray{T,N,AT<:AbstractArray,P,PERM}
Expand Down Expand Up @@ -68,7 +68,7 @@ Base.getindex(p::PickAxisArray,i::CartesianIndex) = p[i.I...]
Takes a list of `variablename=>"Storage Name"` pairs. Checks if all datasets can be found
on disk and loads them. If not, the datasets will be regenerated by evaluating the given expression.
To force recalculation, call `ESDL.recalculate(true)` before evaluating the macro.
To force recalculation, call `EarthDataLab.recalculate(true)` before evaluating the macro.
### Example
Expand Down Expand Up @@ -104,7 +104,7 @@ macro loadOrGenerate(x...)
end
rmEx=Expr(:block,rmEx...)
esc(quote
if !ESDL.recalculate() && all(i->isdir(joinpath(ESDLdir(),i)),$xnames)
if !EarthDataLab.recalculate() && all(i->isdir(joinpath(ESDLdir(),i)),$xnames)
$loadEx
else
$rmEx
Expand Down
2 changes: 1 addition & 1 deletion src/ESDL.jl → src/EarthDataLab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Some info on the project...
"""
module ESDL
module EarthDataLab

include("Proc.jl")
include("countrydict.jl")
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DiskArrayTools = "fcd2136c-9f69-4db6-97e5-f31981721d63"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
ESDL = "359177bc-a543-11e8-11b7-bb015dba3358"
EarthDataLab = "359177bc-a543-11e8-11b7-bb015dba3358"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
NetCDF = "30363a11-5582-574a-97bb-aa9a979735b9"
OnlineStats = "a15396b6-48d5-5d58-9928-6d29437db91e"
Expand Down
4 changes: 2 additions & 2 deletions test/analysis.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using ESDL
using EarthDataLab
using Test
using Dates
import Base.Iterators
using Distributed
using Statistics
addprocs(2)
@everywhere using ESDL, Statistics, NetCDF
@everywhere using EarthDataLab, Statistics, NetCDF

@everywhere function sub_and_return_mean(xout1,xout2,xin)
m=mean(skipmissing(xin))
Expand Down
2 changes: 1 addition & 1 deletion test/artype.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ESDL
using EarthDataLab
using Test
import DataFrames: DataFrame,aggregate
import Dates: year
Expand Down
4 changes: 2 additions & 2 deletions test/online.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ESDL
using EarthDataLab
using Test
using Random
using Statistics
Expand Down Expand Up @@ -39,7 +39,7 @@ covmat,means = mapCube(CovMatrix,dm,MDAxis=VariableAxis)

@test all(isapprox.(covmat.data,cov(reshape(dm.data,length(dm.data) ÷ 2,2))))

using ESDL
using EarthDataLab
using DataStructures
c=Cube()
d2 = getCubeData(c,variable=["air_temperature_2m","gross_primary_productivity"],longitude=(30,31),latitude=(50,51),
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ESDL, NetCDF, YAXArrays
using EarthDataLab, NetCDF, YAXArrays
using Test

newcubedir = mktempdir()
Expand Down
2 changes: 1 addition & 1 deletion test/tabletocube.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ESDL
using EarthDataLab
using Test
using Dates
using IterTools
Expand Down
10 changes: 5 additions & 5 deletions test/transform.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ESDL
using EarthDataLab
using Test
using Statistics

Expand All @@ -14,8 +14,8 @@ d3 = subsetcube(c,variable="net_ecosystem_exchange",lon=(10,11),lat=(50,51),
time=(Date("2002-01-01"),Date("2007-12-31")))
conccube = concatenatecubes([d1,d2],CategoricalAxis("NewAxis",["v1","v2"]))
@test size(conccube)==(4,4,322,2)
@test ESDL.caxes(conccube)[1:3]==ESDL.caxes(d1)
@test ESDL.caxes(conccube)[4]==CategoricalAxis("NewAxis",["v1","v2"])
@test EarthDataLab.caxes(conccube)[1:3]==EarthDataLab.caxes(d1)
@test EarthDataLab.caxes(conccube)[4]==CategoricalAxis("NewAxis",["v1","v2"])
@test_throws ErrorException concatenatecubes([d1,d3],CategoricalAxis("NewAxis",["v1","v2"]))
dd1 = readcubedata(d1)
dd2 = readcubedata(d2)
Expand All @@ -24,10 +24,10 @@ mout = zeros(UInt8,4,4,322,2)
ddconc = readcubedata(conccube)
@test ddconc.data[:,:,:,1] == dd1.data
@test ddconc.data[:,:,:,2] == dd2.data
#@test isa(ESDL.Cubes.gethandle(conccube,(2,2,2,2)),ESDL.CubeAPI.CachedArrays.CachedArray)
#@test isa(EarthDataLab.Cubes.gethandle(conccube,(2,2,2,2)),EarthDataLab.CubeAPI.CachedArrays.CachedArray)
@test mean(ddconc.data,dims=1)[1,:,:,:]==mapslices(meanskipmissing,conccube,dims="Lon").data
conccube2 = concatenatecubes([dd1,dd2],CategoricalAxis("NewAxis",["v1","v2"]))
#@test isa(ESDL.Cubes.gethandle(conccube2,(2,2,2,2)),Tuple{AbstractArray,AbstractArray})
#@test isa(EarthDataLab.Cubes.gethandle(conccube2,(2,2,2,2)),Tuple{AbstractArray,AbstractArray})
@test mean(ddconc.data,dims=1)[1,:,:,:]==mapslices(meanskipmissing,conccube2,dims="Lon").data
end
end

2 comments on commit 1242fd2

@MartinuzziFrancesco
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/59566

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.2 -m "<description of version>" 1242fd2b7ae3086f20b29c0cf966ece90362cda3
git push origin v0.9.2

Also, note the warning: This looks like a new registration that registers version 0.9.2.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.