Skip to content

Commit

Permalink
Release version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Traylor committed May 5, 2021
2 parents 556d369 + 2166cbe commit 03f6094
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 18 deletions.
35 changes: 29 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,27 @@ check_license:
script:
- reuse lint

# The develop branch should reset the version to "0.0.0" so that there can
# never be a confusion with a released version. Compare CONTRIBUTING.md.
check_develop_version:
image: debian:stable-slim
stage: lint
rules:
# Only execute on tags that look like a version, e.g.: "0.5.1"
- if: '$CI_COMMIT_BRANCH == "develop"'
when: always
script:
- echo "If this fails, check the version is reset to '0.0.0' in CITATION.cff and CMakeLists.txt."
- test "0.0.0" == $(grep "^\s*VERSION" CMakeLists.txt | grep -oP '\d+\.\d+\.\d+.*')
- test "0.0.0" == $(grep "^version\s*:" CITATION.cff | grep -oP '\d+\.\d+\.\d+.*')
- echo "'date-released:' in CITATION.cff should be unset."
- grep --silent "^date-released\s*:\s*$" CITATION.cff

# Check that the tag matches the version in the CMakeLists.txt file.
# If the tag doesn’t match, you will need to change CMakeLists.txt and
# forcefully move the tag to the corrected commit.
check_version:
image: ubuntu:latest
check_release_version:
image: debian:stable-slim
stage: lint
rules:
# Only execute on tags that look like a version, e.g.: "0.5.1"
Expand All @@ -37,6 +53,8 @@ check_version:
script:
- echo "If this fails, check that the Git tag matches VERSION in CMakeLists.txt."
- test "$CI_COMMIT_TAG" == $(grep "^\s*VERSION" CMakeLists.txt | grep -oP '\d+\.\d+\.\d+.*')
- echo "If this fails, check that the Git tag matches version in CITATION.cff"
- test "$CI_COMMIT_TAG" == $(grep "^version\s*:" CITATION.cff | grep -oP '\d+\.\d+\.\d+.*')

# Check that all files are correctly formatted according to ".clang-format".
# Exclude the "external/" directory because they will use different formatting.
Expand Down Expand Up @@ -76,6 +94,11 @@ compile:
- build/megafauna_unit_tests
expire_in: 20 minutes

# Compare the Sphinx instructions in "docs/sphinx/conf.py".
# TODO: Currently (2021-05-05), the Docker image "readthedocs/build:latest"
# (7.0) is based on Ubuntu 18.04. It does not contain the required Doxygen
# version 1.8.16 yet. As soon as the readthedocs image is properly updated,
# we should use it here in the CI.
doxygen:
image: ubuntu:latest
stage: build
Expand All @@ -102,7 +125,7 @@ doxygen:
- build/docs/html/

unit_tests:
image: ubuntu:latest
image: gcc:latest
stage: test
needs: ["compile"]
script:
Expand All @@ -112,7 +135,7 @@ unit_tests:
# Check that the linter works and that the example instruction files are
# correct.
linter:
image: ubuntu:latest
image: gcc:latest
stage: test
needs: ["compile"]
script:
Expand All @@ -138,7 +161,7 @@ linter:
- (./build/megafauna_insfile_linter tests/bad_insfiles/two_hfts_with_same_name.toml 2>&1 || true) | grep -iq 'HFT.*is defined twice'

memcheck:
image: ubuntu:latest
image: gcc:latest
stage: test
needs: ["compile"]
before_script:
Expand Down Expand Up @@ -167,7 +190,7 @@ memcheck:
- build/memcheck.log

demo_simulation:
image: ubuntu:latest
image: gcc:latest
stage: test
needs: ["compile"]
script:
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ The format is based on [Keep a Changelog][] by Olivier Lacan, and this project a
[Keep a Changelog]: <https://keepachangelog.com/en/1.0.0/>
[Semantic Versioning]: <https://semver.org/spec/v2.0.0.html>

## [1.0.2] - 2021-05-05

### Changed
- Increase demo simulation years so we can see some population ups and downs.

### Fixed
- The unit tests were broken after the last release.
- cpptoml wouldn’t compile with latest `g++` (11.1.0).

## [1.0.1] - 2021-04-29

### Fixed
Expand Down Expand Up @@ -203,7 +212,8 @@ The format is based on [Keep a Changelog][] by Olivier Lacan, and this project a
[Illius & O’Connor (2000)]: <https://doi.org/10.2307/3800911>
[Taylor et al. (1981)]: <https://doi.org/10.1017/S0003356100040617>

[Unreleased]: https://github.com/wtraylor/modular_megafauna_model/compare/1.0.1...develop
[Unreleased]: https://github.com/wtraylor/modular_megafauna_model/compare/1.0.2...develop
[1.0.1]: https://github.com/wtraylor/modular_megafauna_model/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/wtraylor/modular_megafauna_model/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/wtraylor/modular_megafauna_model/compare/0.6.0...1.0.0
[0.6.0]: https://github.com/wtraylor/modular_megafauna_model/compare/0.5.5...0.6.0
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ authors:
affiliation: Senckenberg Biodiversity and Climate Research Centre
orcid: https://orcid.org/0000-0003-4925-7248
title: "Modular Megafauna Model"
version: 1.0.1
version: 1.0.2
# This DOI represents all versions, and will always resolve to the latest one.
doi: 10.5281/zenodo.4710254
date-released: 2021-04-29
date-released: 2021-05-05
license: LGPL-3.0-or-later
repository-code: https://github.com/wtraylor/modular_megafauna_model
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 3.10)
project ("Modular Megafauna Model"
# This version must match exactly the Git tag!
# Compare the "check_version" job in ".gitlab-ci.yml".
VERSION 1.0.1
VERSION 1.0.2
DESCRIPTION "A physiological, dynamic herbivore simulator in C++."
LANGUAGES CXX
)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPDX-License-Identifier: CC-BY-4.0
[![LGPL logo](docs/images/lgpl.svg)](https://choosealicense.com/licenses/lgpl-3.0/)
[![REUSE-compliant](docs/images/reuse-compliant.svg)][REUSE]
[![Documentation Status](https://readthedocs.org/projects/modular-megafauna-model/badge/?version=latest)](https://modular-megafauna-model.readthedocs.io/en/latest/?badge=latest)
[![Pipeline Status](https://gitlab.com/wtraylor/modular_megafauna_model/badges/master/pipeline.svg)](https://gitlab.com/wtraylor/modular_megafauna_model/-/commits/master)
[![DOI](docs/images/zenodo_doi.svg)](https://zenodo.org/badge/latestdoi/228426088)

[REUSE]: https://reuse.software
Expand Down Expand Up @@ -43,8 +44,7 @@ This project follows the [Pitchfork Layout](https://github.com/vector-of-bool/pi
- `include/`: Public API header files.
- `LICENSES/`: Folder with licenses, compliant with [REUSE][].
- `src/`: Source and (private) header files of the project. Subdirectories correspond to C++ namespaces.
- `tests/`: Unit tests.
- `tests/bad_insfiles/`: Example erroneous example files, each of which should throw an error.
- `tests/`: Unit tests and test scripts.
- `tools/`: Different helper tools for the developer.

Usage
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_simulation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[general]

# Number of simulation years. [1,∞)
years = 20
years = 100

# Number of habitat groups.
habitat_groups = 2
Expand Down
1 change: 1 addition & 0 deletions external/cpptoml/include/cpptoml.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <cstring>
#include <fstream>
#include <iomanip>
#include <limits>
#include <map>
#include <memory>
#include <sstream>
Expand Down
3 changes: 0 additions & 3 deletions src/Fauna/get_forage_demands.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ TEST_CASE("Fauna::calc_allometry()") {

// Typical case without error.
REQUIRE_NOTHROW(calc_allometry(GivenPointAllometry({0.75, Y}), 10, 8));
// Exponent <= 0
CHECK_THROWS(calc_allometry(GivenPointAllometry({-0.1, Y}), 10, 10));
CHECK_THROWS(calc_allometry(GivenPointAllometry({0, Y}), 10, 10));
// Body mass <= 0
CHECK_THROWS(calc_allometry(GivenPointAllometry({0.75, Y}), 0, 10));
CHECK_THROWS(calc_allometry(GivenPointAllometry({0.75, Y}), 10, 0));
Expand Down
4 changes: 2 additions & 2 deletions src/Fauna/hft.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ struct Hft {
/** @{ \name "digestion": Digestion-related parameters. */
/// Parameters for \ref DigestiveLimit::Allometric
/** See documentation in \ref DigestiveLimit::Allometric.*/
GivenPointAllometry digestion_allometric = {0.05, -0.25};
GivenPointAllometry digestion_allometric = {-0.25, 0.05};

/// Factor to change ruminant digestibility for other digestion types.
/**
Expand Down Expand Up @@ -530,7 +530,7 @@ struct Hft {
* \see \ref ExpenditureComponent::FieldMetabolicRate
* \see \ref DigestiveLimit::FixedFraction
*/
GivenPointAllometry expenditure_basal_rate = {7.5, 0.75};
GivenPointAllometry expenditure_basal_rate = {0.75, 7.5};

/// Energy expenditure components, summing up to actual expenditure.
std::set<ExpenditureComponent> expenditure_components = {
Expand Down

0 comments on commit 03f6094

Please sign in to comment.