Skip to content

Commit

Permalink
Reorganized files so that each file is a module
Browse files Browse the repository at this point in the history
Some files have changed names because there were name conflicts (e.g.,
the module `OutputVar`, the function `OutputVar`, and the struct
`OutputVar`).
  • Loading branch information
Sbozzolo committed Jun 25, 2024
1 parent 03fa3e4 commit 284f22c
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
ClimaAnalysis.jl Release Notes
===============================

v0.5.4
------
- Reorganized internal modules so that each file is a module.

v0.5.3
------
- Add `Visualize.contour2D_on_globe!` for discrete contours.
6 changes: 3 additions & 3 deletions src/ClimaAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module ClimaAnalysis
include("Utils.jl")
import .Utils

include("OutputVar.jl")
include("SimDir.jl")
import .SimDir
include("Var.jl")
include("Sim.jl")
import .Sim

include("Visualize.jl")
import .Visualize
Expand Down
4 changes: 4 additions & 0 deletions src/SimDir.jl → src/Sim.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module Sim

import Base: get

export SimDir, available_vars, available_reductions, available_periods
Expand Down Expand Up @@ -191,3 +193,5 @@ end
Check if the given SimDir contains OutputVars.
"""
Base.isempty(simdir::SimDir) = isempty(simdir.vars)

end
6 changes: 5 additions & 1 deletion src/OutputVar.jl → src/Var.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module Var

import NCDatasets
import OrderedCollections: OrderedDict

import Statistics: mean

import .Utils: nearest_index, seconds_to_prettystr
import ..Utils: nearest_index, seconds_to_prettystr

export OutputVar,
read_var,
Expand Down Expand Up @@ -518,3 +520,5 @@ end
@overload_binary_op (-)
@overload_binary_op (*)
@overload_binary_op (/)

end
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ using Test
@safetestset "Docstrings" begin @time include("doctest.jl") end
@safetestset "Format" begin @time include("format.jl") end

@safetestset "Utils" begin @time include("Utils.jl") end
@safetestset "SimDir" begin @time include("SimDir.jl") end
@safetestset "OutputVar" begin @time include("OutputVar.jl") end
@safetestset "CairoMakieExt" begin @time include("CairoMakieExt.jl") end
@safetestset "GeoMakieExt" begin @time include("GeoMakieExt.jl") end
@safetestset "Utils" begin @time include("test_Utils.jl") end
@safetestset "SimDir" begin @time include("test_Sim.jl") end
@safetestset "OutputVar" begin @time include("test_Var.jl") end
@safetestset "CairoMakieExt" begin @time include("test_CairoMakieExt.jl") end
@safetestset "GeoMakieExt" begin @time include("test_GeoMakieExt.jl") end
#! format: on

nothing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 284f22c

Please sign in to comment.