Skip to content
Open
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
53 changes: 49 additions & 4 deletions .github/actions/before-script/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ runs:
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y git glpk-utils g++ cmake wget curl python3-pip
pip install conan
conan profile detect
sudo apt-get install -y git g++ cmake wget curl python3-pip
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
source "$HOME/miniconda/etc/profile.d/conda.sh"

conda create --name testenv python=3.11 -y
conda activate testenv
conda install -c conda-forge poetry -y
conda install -c conda-forge -y poetry highs highspy conan
conan profile detect

cd "$GITHUB_WORKSPACE/test/python_module"
poetry install
Expand All @@ -41,3 +40,49 @@ runs:
cmake --build . --config Release
cd "$GITHUB_WORKSPACE"
shell: bash
- name: Install Windows dependencies + Miniconda + python/cpp modules
if: runner.os == 'Windows'
run: |
# Download & install Miniconda into %USERPROFILE%\miniconda
$installer = Join-Path $env:RUNNER_TEMP "Miniconda3-latest-Windows-x86_64.exe"
Invoke-WebRequest -Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" -OutFile $installer

$target = Join-Path $env:USERPROFILE "miniconda"
Start-Process -FilePath $installer -ArgumentList "/InstallationType=JustMe", "/S", "/D=$target" -Wait

# Initialize conda for this PowerShell session
$conda = Join-Path $target "Scripts\conda.exe"
& $conda "shell.powershell" "hook" | Out-String | Invoke-Expression

conda create --name testenv python=3.11 -y
conda activate testenv
$env:PATH = "$env:CONDA_PREFIX\Scripts;$env:CONDA_PREFIX;$env:PATH"
python -m pip install --upgrade pip
conda install -c conda-forge -y poetry highs highspy conan
conan profile detect

# Check highs installation
where.exe highs
highs --version

# Poetry installs
Set-Location (Join-Path $env:GITHUB_WORKSPACE "test\python_module")
poetry install
Set-Location (Join-Path $env:GITHUB_WORKSPACE "submodules\wind_power_timeseries")
poetry install
Set-Location (Join-Path $env:GITHUB_WORKSPACE "submodules\Tecnalia_Solar-Energy-Model")
poetry install
Set-Location (Join-Path $env:GITHUB_WORKSPACE "submodules\Tecnalia_Building-Stock-Energy-Model")
poetry install

Set-Location (Join-Path $env:GITHUB_WORKSPACE "submodules\CHP_modelling")
New-Item -ItemType Directory -Force -Path "build" | Out-Null
Set-Location "build"

conan install .. --output-folder=. --build=missing -s compiler.cppstd=17 -s arch=x86_64

cmake .. -DCMAKE_TOOLCHAIN_FILE="$PWD\conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release

Set-Location $env:GITHUB_WORKSPACE
shell: pwsh
29 changes: 26 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ jobs:
- version: 'lts' # The long term stable version (Linux)
os: ubuntu-latest
arch: x64
- version: '1'
os: windows-latest
arch: x64
- version: 'lts'
os: windows-latest
arch: x64
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch the submodules
fetch-depth: 0 # full clone
submodules: true
fetch-depth: 0

# Recommended: ensure MSVC environment for conan/cmake on Windows
- name: Setup MSVC Dev Cmd
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- uses: ./.github/actions/before-script
- uses: julia-actions/setup-julia@v2
with:
Expand All @@ -41,7 +53,8 @@ jobs:
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- name: Run Julia tests inside the testenv-enviornment in Miniconda
- name: Run Julia tests inside the testenv-enviornment in Miniconda (Linux)
if: runner.os == 'Linux'
run: |
source "$HOME/miniconda/etc/profile.d/conda.sh"
conda init bash
Expand All @@ -53,3 +66,13 @@ jobs:
Pkg.test(; coverage=true)
'
shell: bash
- name: Run Julia tests inside the testenv-environment in Miniconda (Windows)
if: runner.os == 'Windows'
run: |
$conda = Join-Path $env:USERPROFILE "miniconda\Scripts\conda.exe"
& $conda "shell.powershell" "hook" | Out-String | Invoke-Expression
conda activate testenv
$env:PATH = "$env:CONDA_PREFIX;$env:CONDA_PREFIX\Scripts;$env:PATH"

julia --project=. -e 'using Pkg; ENV["PYTHON"] = joinpath(ENV["USERPROFILE"], "miniconda", "envs", "testenv", "python.exe"); Pkg.build("PyCall"); Pkg.test(; coverage=true)'
shell: pwsh
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Version 0.1.0 (2025-04-xx)

### Improve documentation (2026-01-06)

* Added documentation for the node and a `how-to` section for the sampling constructors of these nodes.
* Added CI test runs for windows

### Adjust for updates in submodules and update descriptive names for the EMGUI extension (2025-10-17)

* Adjust for updates in submodules
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
EnergyModelsBase = "5d7e687e-f956-46f3-9045-6f5a5fd49f50"
EnergyModelsHeat = "ad1b8b27-e232-4da9-b498-bea9c19a30d7"
EnergyModelsLanguageInterfaces = "672bb132-9406-42d0-9ef4-9203b0a61e9a"
EnergyModelsRenewableProducers = "b007c34f-ba52-4995-ba37-fffe79fbde35"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Expand Down
11 changes: 10 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ using Documenter
using DocumenterInterLinks
using EnergyModelsBase
using EnergyModelsRenewableProducers
using EnergyModelsHeat
using EnergyModelsLanguageInterfaces
using TimeStruct
using Dates
using Literate

const EMB = EnergyModelsBase
Expand All @@ -20,6 +22,7 @@ Literate.markdown(inputfile, joinpath(@__DIR__, "src", "examples"))
links = InterLinks(
"TimeStruct" => "https://sintefore.github.io/TimeStruct.jl/stable/",
"EnergyModelsBase" => "https://energymodelsx.github.io/EnergyModelsBase.jl/stable/",
"EnergyModelsRenewableProducers" => "https://energymodelsx.github.io/EnergyModelsRenewableProducers.jl/stable/",
)

makedocs(
Expand All @@ -37,7 +40,13 @@ makedocs(
"Quick Start"=>"manual/quick-start.md",
"Release notes"=>"manual/NEWS.md",
],
"Types for EMX elements" => Any["Reference"=>"types/reference.md"],
"Nodes" => Any[
"BioCHP"=>"nodes/biochp.md",
"WindPower"=>"nodes/windpower.md",
"PVandCSP"=>"nodes/pvandcsp.md",
"MultipleBuildingTypes"=>"nodes/multiplebuildingtypes.md",
],
"Resources" => Any["ResourceBio"=>"resources/resourcebio.md"],
"Utility functions" => Any["Reference"=>"util-fun/reference.md"],
"How-to" =>
Any["Contribute"=>"how-to/contribute.md", "Utilize"=>"how-to/utilize.md"],
Expand Down
Loading