Skip to content

Commit

Permalink
Merge branch 'main' into schema-timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
Batch21 committed Feb 29, 2024
2 parents 2b308ec + 5663852 commit e5c6822
Show file tree
Hide file tree
Showing 72 changed files with 2,478 additions and 1,034 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy book
on:
# Deploy the book when the Rust (Linux) workflow completes on main
workflow_run:
workflows: ["Rust (Linux)"]
branches: [main]
types:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
# This assumes your book is in the root of your repository.
# Just add a `cd` here if you need to change to another directory.
mdbook build ./pywr-book
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './pywr-book/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ default-members = [
"pywr-core",
"pywr-schema",
"pywr-cli",
"pywr-python",
# "pywr-python",
]


Expand All @@ -35,14 +35,14 @@ opt-level = 3 # fast and small wasm
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0.25"
time = { version = "0.3", features = ["serde", "serde-well-known", "serde-human-readable", "macros"] }
num = "0.4.0"
ndarray = "0.15.3"
polars = { version = "0.37.0", features = ["lazy", "rows", "ndarray"] }
pyo3-polars = "0.11.1"
pyo3 = { version = "0.20.2" }
tracing = "0.1"
pyo3 = { version = "0.20.2", default-features = false }
pyo3-log = "0.9.0"
tracing = { version = "0.1", features = ["log"] }
csv = "1.1"
hdf5 = { version="0.8.1" }
hdf5-sys = { version="0.8.1", features=["static"] }
pywr-v1-schema = { git = "https://github.com/pywr/pywr-schema/", tag="v0.9.0", package = "pywr-schema" }
hdf5 = { git = "https://github.com/aldanor/hdf5-rust.git", package = "hdf5", features = ["static", "zlib"] }
pywr-v1-schema = { git = "https://github.com/pywr/pywr-schema/", tag = "v0.11.0", package = "pywr-schema" }
chrono = { version = "0.4.34" }
6 changes: 5 additions & 1 deletion clp-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
name = "clp-sys"
version = "0.1.0"
authors = ["James Tomlinson <[email protected]>"]
edition = "2018"
edition = "2021"
description = "Low-level bindings to COIN-OR CLP (Coin-or linear programming)."
license = "MIT OR Apache-2.0"
repository = "https://github.com/pywr/pywr-next/"


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
19 changes: 12 additions & 7 deletions clp-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,28 @@ fn make_builder() -> cc::Build {
.to_owned();

if target.contains("msvc") {
builder.flag("-EHsc").flag_if_supported("-std:c++11");
builder.flag("-EHsc");
// Flag required for macros __cplusplus to work correctly.
// See: https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
builder.flag("/Zc:__cplusplus");
builder.flag("/std:c++14");
} else {
builder.flag("-std=c++11").flag("-w");
builder.flag("-std=c++11");
builder.flag("-w");
}

builder
}

fn main() {
const COIN_UTILS_SRC: &str = "vendor/CoinUtils/src";
const COIN_CLP_SRC: &str = "vendor/Clp/src";
const COIN_UTILS_SRC: &str = "vendor/CoinUtils/CoinUtils/src";
const COIN_CLP_SRC: &str = "vendor/Clp/Clp/src";

// Compile CoinUtils
let mut builder = make_builder();

builder
.flag(&*format!("-I{}", COIN_UTILS_SRC))
.flag(&format!("-I{}", COIN_UTILS_SRC))
.file(format!("{}/CoinAlloc.cpp", COIN_UTILS_SRC))
.file(format!("{}/CoinBuild.cpp", COIN_UTILS_SRC))
.file(format!("{}/CoinDenseFactorization.cpp", COIN_UTILS_SRC))
Expand Down Expand Up @@ -104,8 +109,8 @@ fn main() {
let mut builder = make_builder();

builder
.flag(&*format!("-I{}", COIN_UTILS_SRC))
.flag(&*format!("-I{}", COIN_CLP_SRC))
.flag(&format!("-I{}", COIN_UTILS_SRC))
.flag(&format!("-I{}", COIN_CLP_SRC))
.file(format!("{}/ClpCholeskyBase.cpp", COIN_CLP_SRC))
.file(format!("{}/ClpCholeskyDense.cpp", COIN_CLP_SRC))
.file(format!("{}/ClpCholeskyPardiso.cpp", COIN_CLP_SRC))
Expand Down
Loading

0 comments on commit e5c6822

Please sign in to comment.