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

Preparations for a new major release #21

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/normalCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
CURRY_RUN_GOLDEN: true # run golden tests, see the README for more info
steps:
- uses: actions/checkout@v4
- uses: freckle/stack-action@v4
- uses: freckle/stack-action@v5
with:
stack-arguments: --coverage
# prepare and upload test coverage report
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
name: Release ${{ github.ref_name }}
draft: true

build_artifact:
build_normal_artifacts:
needs: [create_release]
name: ${{ matrix.os }}/${{ github.ref }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-latest]
os: [ubuntu-20.04, macOS-13, macOS-14, windows-latest]

steps:
- name: Check out code
Expand All @@ -40,21 +40,34 @@ jobs:
tagRegex: "v(.*)"
tagRegexGroup: 1

- name: Install stack on macOS, where it is not present (https://github.com/freckle/stack-action/issues/80)
if: ${{ runner.os == 'macOS' }}
run: curl -sSL https://get.haskellstack.org/ | sh

- name: Build executable
uses: freckle/stack-action@v4
uses: freckle/stack-action@v5
id: stack
with:
stack-arguments: --copy-bins
test: false
stack-build-arguments: --copy-bins --ghc-options="-O2"

- name: Set binary path name
id: binarypath
run: |
currentEXE="${{ steps.stack.outputs.local-bin }}/currycarbon"
newEXE="currycarbon-$RUNNER_OS"
mv $currentEXE $newEXE
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT
if [ "$RUNNER_OS" == "Windows" ]; then
newEXE="currycarbon-$RUNNER_OS.exe"
elif [ "$RUNNER_OS" == "macOS" ]; then
newEXE="currycarbon-$RUNNER_OS-$RUNNER_ARCH"
else
newEXE="currycarbon-$RUNNER_OS"
fi
currentEXE="${{ steps.stack.outputs.local-bin }}/currycarbon"
mv $currentEXE $newEXE
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT
shell: bash

- name: Compress binary
if: ${{ runner.os != 'macOS' }} # upx is crashing for macOS Ventura or above!
uses: svenstaro/upx-action@v2
with:
files: ${{ steps.binarypath.outputs.BINARY_PATH }}
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
- V 0.4.0.0: Another major update:
- Added the command line options `--noTrimCalCurve` and `--noTrimOutCalPDF` to allow control over the pre- and post-calibration trimming behaviour for radiocarbon dates.
- Changed the way products between calibration expressions are computed in `evalCalExpr`. Input expressions in a multiplication are now calibrated for the entire length of the calibration curve. This allows to compute proper products and not fail in case of non-overlapping output.
- Changed the way calibration curves are embedded in currycarbon. This now uses the brilliant `file-embed` library.
- Changed the interface of the core calibration functions. `CalibrateDatesConf` no longer includes the `CalibrationMethod`, so `calibrateDates` and `evalNamedCalExpr` functions need it as an extra argument. `calibrateDateBchron` and `calibrateDateMatrixMult` now take `CalibrateDatesConf` and not its individual elements.
- Moved from Float to Double for probability densities and all functions that interact with them.
- Added a new output option `--basicFile` to the CLI to enable simple per-expression output: The minimum start and maximum end of the high probability density regions and the median age. In this context `writeCalC14` was split into `writeCalC14HDR` and `writeCalC14CalRangeSummary` in the library.
- Changed the release pipeline: Now again with a windows executable. currycarbon-macOS was replaced by currycarbon-macOS-X64 and currycarbon-macOS-ARM64.
- Switched to a new stackage resolver version (lts-21.21).
- V 0.3.0.1: The golden tests can not run on stackage as it stands, so I hid them behind an environment variable.
- V 0.3.0.0: Major update with multiple breaking changes and new features:
- Added a new mechanism to draw random age samples from a CalPDF (`sampleAgesFromCalPDF :: AgeSamplingConf -> CalPDF -> RandomAgeSample`). This is available from the command line with the options `samplesFile`, `--seed`, and `-n`/`--nrSamples`.
Expand Down
11 changes: 6 additions & 5 deletions currycarbon.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: currycarbon
version: 0.3.0.1
version: 0.4.0.0
synopsis: A package for simple, fast radiocarbon calibration
description: Radiocarbon calibration with the intercept method optimised for fast calibration of many dates.
homepage: https://github.com/nevrome/currycarbon
Expand Down Expand Up @@ -33,14 +33,15 @@ library
Currycarbon.Utils
hs-source-dirs:
src
build-depends:
build-depends:
base >= 4.14 && < 5
, filepath >= 1.4 && < 1.5
, filepath >= 1.4 && < 1.6
, parsec >= 3.1 && < 3.2
, vector >= 0.12 && < 0.14
, math-functions >= 0.3 && < 0.4
, MonadRandom >= 0.6 && < 1
, random > 1.2 && < 1.3
, file-embed > 0.0.11.1 && < 0.1.0.0
default-language:
Haskell2010

Expand All @@ -53,13 +54,13 @@ executable currycarbon
currycarbon
, base >= 4.14 && < 5
, optparse-applicative >= 0.16 && < 0.19
, filepath >= 1.4 && < 1.5
, filepath >= 1.4 && < 1.6
other-modules:
Paths_currycarbon
default-language:
Haskell2010
ghc-options:
-threaded -with-rtsopts=-N -optP-Wno-nonportable-include-path
-threaded -O2 -with-rtsopts=-N -optP-Wno-nonportable-include-path

test-suite spec
hs-source-dirs:
Expand Down
3 changes: 3 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Calibration curves

- intcal20: Reimer et al. 2020, doi: [10.1017/RDC.2020.41](https://doi.org/10.1017/RDC.2020.41)
Loading
Loading