Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding benchmarks and extra sanity checks (memory allocations, type stability, ...) #115

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
69 changes: 69 additions & 0 deletions .github/workflows/Integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Integration
on:
push:
branches:
- main
tags: "*"
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- "1.9"
- "1"
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
package:
#- {user: PalmStudio, repo: XPalm.jl}
- {user: VEZY, repo: PlantBioPhysics.jl}
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@v1
- name: Clone Downstream
uses: actions/checkout@v4
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
- name: Load this and run the downstream tests
shell: julia --threads 4 --color=yes --project=downstream --depwarn=yes {0}
run: |
using Pkg
try
# force it to use this PR's version of the package
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.update()
Pkg.test() # resolver may fail with test time deps
catch err
err isa Pkg.Resolve.ResolverError || rethrow()
# If we can't resolve that means this is incompatible by SemVer and this is fine
# It means we marked this as a breaking change, so we don't need to worry about
# Mistakenly introducing a breaking change, as we have intentionally made one
@info "Testing with an incompatible downstream release as a breaking change was introduced. Expected failure." exception=err
exit(0) # Exit immediately, as a success
end
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
files: lcov.info
6 changes: 6 additions & 0 deletions src/component_models/Status.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ function Base.indexed_iterate(mnt::Status, i::Int, state=1)
Base.indexed_iterate(NamedTuple(mnt), i, state)
end

function Base.:(==)(s1::Status, s2::Status)
return (length(s1) == length(s2)) &&
(propertynames(s1) == propertynames(s2)) &&
(values(s1) == values(s2))
end


"""
propagate_values!(status1::Dict, status2::Dict, vars_not_propagated::Set)
Expand Down
6 changes: 1 addition & 5 deletions src/dependencies/hard_dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,7 @@ function hard_dependencies(mapping::Dict{String,T}; verbose::Bool=true) where {T
# so keep tabs on them during initialisation until they're no longer needed
hard_dependency_dict = Dict{Pair{Symbol, String}, HardDependencyNode}()

hard_deps = Dict()

for (organ, mods_scale) in mods
hard_deps[organ] = hard_dependencies(mods_scale, scale=organ, verbose=false)
end
hard_deps = Dict(organ => hard_dependencies(mods_scale, scale=organ, verbose=false) for (organ, mods_scale) in mods)

# Compute the inputs and outputs of all "root" node of the hard dependencies, so the root
# node that takes control over other models appears to have the union of its own inputs (resp. outputs)
Expand Down
Loading
Loading