diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 01bfab9..4bd79bd 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1 +1,13 @@ -# See https://domluna.github.io/JuliaFormatter.jl/stable/ for a list of options +# Configuration file for JuliaFormatter.jl +# For more information, see: https://domluna.github.io/JuliaFormatter.jl/stable/config/ +# This is (loosely) based on the formatting that https://github.com/jump-dev/JuMP.jl uses + +always_for_in = true +always_use_return = true +margin = 120 +remove_extra_newlines = true +separate_kwargs_with_semicolon = true +short_to_long_function_def = false +whitespace_typedefs = true +whitespace_in_kwargs = false +whitespace_ops_in_indices = true diff --git a/.gitignore b/.gitignore index 95731a5..f6b3687 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /Manifest.toml /docs/Manifest.toml /docs/build/ +/docs/src/pages/changelog.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4d1a765 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2023-06-01 + +### Added + +- Initial public release of IESopt.jl diff --git a/Project.toml b/Project.toml index ba5e1a0..5c29086 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,56 @@ name = "IESopt" uuid = "ed3f0a38-8ad9-4cf8-877e-929e8d190fe9" -authors = ["Stefan Strömer and contributors"] version = "1.0.0" +[deps] +ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" +IESoptLib = "b98f706d-40ec-4ce6-a66c-1c6e71d3cef6" +JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +JuMP = "4076af6c-e467-56ae-b986-b466b2749572" +LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36" +Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" +MultiObjectiveAlgorithms = "0327d340-17cd-11ea-3e99-2fd5d98cecda" +OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" +ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" +RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" +Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" +Tectonic = "9ac5f52a-99c6-489f-af81-462ef484790f" +YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" +ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" + [compat] +ArgCheck = "2.3.0" +CSV = "0.10" +DataFrames = "1.6" +Dates = "<0.0.1,1" +HiGHS = "1.9" +IESoptLib = "0.1" +JLD2 = "0.4" +JSON = "0.21" +JuMP = "1.22" +LibGit2 = "<0.0.1,1" +Logging = "<0.0.1,1" +LoggingExtras = "1.0" +Markdown = "<0.0.1,1" +MultiObjectiveAlgorithms = "1.3" +OrderedCollections = "1.6" +Pkg = "1.10" +PrecompileTools = "1.2" +Printf = "<0.0.1,1" +ProgressMeter = "1.10" +RuntimeGeneratedFunctions = "0.5.13" +Suppressor = "0.2" +Tectonic = "0.8" +YAML = "0.4" +ZipFile = "0.10" julia = "1.9" diff --git a/README.md b/README.md index 6611deb..f93a581 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,9 @@ **IESopt** (_Integrated Energy System Optimization_) is a modeling and optimization framework for integrated energy systems. +> Note: We are currently moving from our internal version control to GitHub. Missing contents will be added during the +> upcoming days ... + ## Table of Contents - [Background](#background) @@ -28,15 +31,15 @@ TODO ## Install -TODO: Documment how to install the package. +TODO: Document how to install the package. ## Usage -TODO: Documment how to use the package. +TODO: Document how to use the package. ## API -TODO: Documment the API of the package. +TODO: Document the API of the package. ### Python diff --git a/docs/Project.toml b/docs/Project.toml index d786057..f510157 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,5 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" IESopt = "ed3f0a38-8ad9-4cf8-877e-929e8d190fe9" +IESoptLib = "b98f706d-40ec-4ce6-a66c-1c6e71d3cef6" +LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" diff --git a/docs/changelog.jl b/docs/changelog.jl new file mode 100644 index 0000000..32dbb3d --- /dev/null +++ b/docs/changelog.jl @@ -0,0 +1,14 @@ +function create_changelog() + PATH_ROOT = dirname(@__DIR__) + PATH_DOCS = joinpath(PATH_ROOT, "docs") + + # Read the changelog file. + changelog = read(joinpath(PATH_ROOT, "CHANGELOG.md"), String) + + # Write the changelog. + open(joinpath(PATH_DOCS, "src", "pages", "changelog.md"), "w") do f + write(f, changelog) + end +end + +create_changelog() diff --git a/docs/generate.jl b/docs/generate.jl new file mode 100644 index 0000000..6ce0f6d --- /dev/null +++ b/docs/generate.jl @@ -0,0 +1,43 @@ +_canonify_string(str::String) = lowercase(replace(str, r"[^a-zA-Z0-9]" => "_")) + +function _build_page_paths(entry; parent::String) + isa(entry, String) && return joinpath(parent, "$(_canonify_string(entry)).md") + isa(entry, AbstractVector) && return [_build_page_paths(subentry; parent=parent) for subentry in entry] + + isa(entry, Pair) || error("Invalid type of entry in page structure") + + isa(entry.second, String) && return entry.first => "$(_canonify_string(entry.second)).md" + + if isa(entry.second, AbstractVector) && length(entry.second) == 1 + return joinpath(parent, "$(_canonify_string(entry.second[1])).md") + end + + return entry.first => _build_page_paths(entry.second; parent=joinpath(parent, _canonify_string(entry.first))) +end + +# This defines the order of the menu / page structure. +examples_files = [ + file[1:(end - 3)] for + file in readdir(normpath(@__DIR__, "src", "pages", "user_guide", "examples")) if endswith(file, ".md") +] + +_PAGES = _build_page_paths( + [ + "Home" => "index", + "Tutorials" => ["setup", "first_model", "next_steps", "results"], + "User Guide" => [ + "general", + "Sectors" => ["electricity", "heat", "gas"], + "solvers", + "Custom Functionality" => ["templates", "addons"], + "Examples" => [], # TODO: examples_files, + ], + "Manual" => ["yaml", "core_components", "templates", "api"], + "Developer Documentation" => ["dev_docs"], + "Changelog" => ["changelog"], + ]; + parent="pages", +) + +# Create `changelog.md` from `CHANGELOG.md`. +include("changelog.jl") diff --git a/docs/liveserver.jl b/docs/liveserver.jl new file mode 100644 index 0000000..b2b6e7e --- /dev/null +++ b/docs/liveserver.jl @@ -0,0 +1,33 @@ +# Build and serve the documentation locally, with live updates, by using this file: +# ```shell +# julia --project=. -e 'include("docs/liveserver.jl")' +# ``` + +const PATH_ROOT = dirname(@__DIR__) +const PATH_DOCS = joinpath(PATH_ROOT, "docs") + +# Make sure `docs` environment is set up properly. +import Pkg +Pkg.activate(@__DIR__) +Pkg.instantiate() + +# Communicate with `make.jl` that we are running in live mode, so that we can load `Revise` there. +push!(ARGS, "running_local_liveserver") + +# Serve documentation now. +import LiveServer +LiveServer.servedocs(; + include_dirs = [ + joinpath(PATH_ROOT, "src"), # watch `src/` for changes (to update docstrings) + ], + include_files = [ + joinpath(PATH_DOCS, "generate.jl"), # watch `generate.jl` for changes (to regenerate docs) + joinpath(PATH_DOCS, "changelog.jl"), # watch `changelog.jl` for changes (to regenerate changelog) + joinpath(PATH_ROOT, "CHANGELOG.md"), # watch `CHANGELOG.md` for changes (to regenerate changelog) + ], + skip_files = [ + joinpath(PATH_DOCS, "src", "pages", "changelog.md"), # don't watch this, because it's generated by `generate.jl` + ], + launch_browser = true, + verbose = true, +) diff --git a/docs/make.jl b/docs/make.jl index ffc2c45..8c0338d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,23 +1,49 @@ +const is_local_draft = "running_local_liveserver" in ARGS +const running_in_ci = haskey(ENV, "CI") || haskey(ENV, "GITHUB_ACTIONS") + +if is_local_draft + try + import Revise + Revise.revise() + catch + @warn "Building documentation without Revise support. If you want to automatically refresh docstrings from withing IESopt.jl, you need Revise installed." + end +end + using IESopt using Documenter -# DocMeta.setdocmeta!(IESopt, :DocTestSetup, :(using IESopt); recursive=true) +# Set up, and generate everything as needed. +include("generate.jl") +# Build documentation. makedocs(; - modules=[IESopt], + sitename="-- IESopt --", authors="Stefan Strömer (@sstroemer), Daniel Schwabeneder (@daschw), and contributors", - sitename="IESopt.jl", format=Documenter.HTML(; canonical="https://ait-energy.github.io/IESopt.jl", edit_link="dev", - assets=String[], + prettyurls=true, + collapselevel=2, + mathengine=Documenter.MathJax2(), + highlights=["yaml", "python"], + assets=[ + asset("assets/base_template.css"; class=:css, islocal=true), + ], + size_threshold=300_000, + size_threshold_warn=200_000, ), - pages=[ - "Home" => "index.md", - ], + pages=_PAGES, + doctest = false, + pagesonly = true, + warnonly = true, + draft = is_local_draft, ) -deploydocs(; - repo="github.com/ait-energy/IESopt.jl", - devbranch="dev", -) +# Deploy documentation, if we are not running locally. +if !is_local_draft + deploydocs(; + repo="github.com/ait-energy/IESopt.jl", + devbranch="dev", + ) +end diff --git a/docs/src/assets/base_template.css b/docs/src/assets/base_template.css new file mode 100644 index 0000000..99b74ed --- /dev/null +++ b/docs/src/assets/base_template.css @@ -0,0 +1,15 @@ +@media screen and (min-width: 1056px) { + .docs-main { + max-width: 65rem !important; + } + + .content { + text-align: justify; + } +} + +img.center { + display: block; + margin-left: auto; + margin-right: auto; +} diff --git a/docs/src/assets/chp_linearization.jpg b/docs/src/assets/chp_linearization.jpg new file mode 100644 index 0000000..4616ce4 Binary files /dev/null and b/docs/src/assets/chp_linearization.jpg differ diff --git a/docs/src/assets/first_model.png b/docs/src/assets/first_model.png new file mode 100644 index 0000000..adcf1a0 Binary files /dev/null and b/docs/src/assets/first_model.png differ diff --git a/docs/src/assets/math_model.JPG b/docs/src/assets/math_model.JPG new file mode 100644 index 0000000..d9cc3e6 Binary files /dev/null and b/docs/src/assets/math_model.JPG differ diff --git a/docs/src/index.md b/docs/src/index.md index 4a6aac7..7b4a356 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,14 +1,77 @@ +# IESopt.jl + +_**Integrated Energy System Optimization** framework written in Julia._ + +## Introduction + +`IESopt.jl` is the core of the IESopt framework, developed at [AIT Austrian Institute of Technology GmbH](https://www.ait.ac.at/). +It is written in Julia, and uses [JuMP](https://github.com/jump-dev/JuMP.jl) package to construct the underlying +mathematical optimization models, and to interface with various solvers. The model is designed to be modular, and allows +for easy extension and customization. + ```@meta -CurrentModule = IESopt +# TODO: add "The main functionalities of IESopt.jl are: ..." itemize here. +# TODO: add gitter here +# TODO: cleanup the "About" section, and integrate it here ``` -# IESopt +Check out the following GitHub repositories for more information: -Documentation for [IESopt](https://github.com/ait-energy/IESopt.jl). +- [IESopt.jl](https://github.com/ait-energy/IESopt.jl), the core model (a Julia package). +- [iesopt-py](https://github.com/ait-energy/iesopt-py), the Python interface. -```@index -``` +!!! danger "Moving to open-source" + We are currently working (hard) on getting IESopt fully open-source on GitHub, which requires some clean-up of + (potentially) confindential left-overs (e.g., from projects). Meanwhile, a lot of internals are changing (after + staying fixed for a long time), and the documentation needs to be checked page-by-page. If you are trying to + get started before we manage to fix everything, get in touch with us directly - we'll help you set up everything you + need. The documentation currently consists of mostly structured pages, with the content being added as soon as + possible. + +## Installation + +!!! details "Using Python" + To be added. + +!!! details "Using Julia" + To be added. + +## Citation + +If you find IESopt useful in your work, and are intend to publish or document your modeling, we kindly request that you +include the following citation: + +- **Style: APA7** + > Strömer, S., Schwabeneder, D., & contributors. (2021-2024). _IESopt: Integrated Energy System Optimization_ [Software]. AIT Austrian Institute of Technology GmbH. [https://github.com/ait-energy/IESopt](https://github.com/ait-energy/IESopt) +- **Style: IEEE** + > [1] S. Strömer, D. Schwabeneder, and contributors, _"IESopt: Integrated Energy System Optimization,"_ AIT Austrian Institute of Technology GmbH, 2021-2024. [Online]. Available: [https://github.com/ait-energy/IESopt](https://github.com/ait-energy/IESopt) +- **BibTeX:** + ```bibtex + @misc{iesopt, + author = {Strömer, Stefan and Schwabeneder, Daniel and contributors}, + title = {{IES}opt: Integrated Energy System Optimization}, + organization = {AIT Austrian Institute of Technology GmbH}, + url = {https://github.com/ait-energy/IESopt}, + type = {Software}, + year = {2021-2024}, + } + ``` + +```@meta +# ## About + +# ### Overview + +# IESopt, _Integrated Energy System Optimization_, is a general purpose energy system optimization framework, developed at the [Center for Energy](https://www.ait.ac.at/en/about-the-ait/center/center-for-energy), at [AIT Austrian Institute of Technology GmbH](https://www.ait.ac.at/), mainly developed and maintained by the unit [Integrated Energy Systems](https://www.ait.ac.at/en/research-topics/integrated-energy-systems). + +# ### Feature summary + +# What IESopt is, may be, and is not: -```@autodocs -Modules = [IESopt] +# - YES +# - IESopt is a general purpose energy system (optimization) model. It supports multiple solvers (using `JuMP.jl` to interface with them) as well as a standardized way to build up models using "core components". +# - MAYBE +# - IESopt.jl is not branded as JuMP extension. It plays nicely with JuMP, and some extensions, but we currently do not see it as a fully fledged JuMP extension. That, e.g., entails that `copy_extension_data` is not implemented at the moment, so `copy_model` is not supported. This is a deliberate choice, and may be changed in the - near or far - future. +# - NO (really ...) +# - A full energy system model, in the sense of "containing data". There are a lot of good, and open, data sources out there from other teams, consider using them. ``` diff --git a/docs/src/pages/dev_docs.md b/docs/src/pages/dev_docs.md new file mode 100644 index 0000000..376610a --- /dev/null +++ b/docs/src/pages/dev_docs.md @@ -0,0 +1,153 @@ +# Developer Documentation + +The following sections provide rough guidelines on how to work with IESopt, and mostly IESopt.jl, improving the documentation, testing, and implementing new features. + +!!! info "Helping out" + Looking for things to contribute, with a low entry barrier (besides any open issue)? Check for `To be added` (especially in the documentation), or `TODO` (especially in the code). + +## Getting started + +### General + +1. Install [Julia](https://julialang.org/downloads/). +2. Install [VSCode](https://code.visualstudio.com/), and some [extensions](#working-with-vscode) _(this step is optional, but highly recommended)_. +3. Clone/fork the repository. +4. Happy coding (... see below)! + +> If you are new to Julia, or not entirely sure how everything works - let's talk. We are happy to help you get started, and to guide you through the process. Stuff like [Revise.jl](https://timholy.github.io/Revise.jl/) can be a huge help, and we can show you how to use it. Further, if you are coming from, e.g., a standard Python background, the advantages of a dynamic REPL-driven development may be new to you. + +### Tips and tricks + +- Check out [Modern Julia Workflows](https://modernjuliaworkflows.github.io/). +- Check out the [Julia Discourse](https://discourse.julialang.org/). +- Read up details on [Revise usage](https://timholy.github.io/Revise.jl/stable/cookbook/). + +## Architecture + +See [ARCHITECTURE.md](https://github.com/ait-energy/IESopt.jl/main/blob/main/ARCHITECTURE.md) for more information. + +## Coding conventions + +### Branches + +We mainly use a ["feature branch workflow"](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow), similar to ["trunk based development"](https://trunkbaseddevelopment.com/). We strive to keep the `main` branch as clean as possible (docs and tests should build and pass), and work on a separate `development` (trunk) branch. For larger changes, consider starting new feature branches. Where possible we use PRs (or merge requests) to get changes into the `main` branch, while doing a (light) code review for each other. + +### Naming conventions + +#### Julia + +We make use of the following naming conventions, which slightly differ from the [Julia naming conventions](https://docs.julialang.org/en/v1/manual/style-guide/1), but are similar to other large projects out there: + +- Types and similar items use `CamelCase`, e.g., `MyType`. +- Functions and variables use `snake_case`, e.g., `my_function(...)`. +- Functions that modify their arguments should end with an exclamation mark, e.g., `optimize!(...)`. +- Functions and variables should actually make use of underscores, whenever reasonable (and not only when absolutely necessary), e.g., `set_to_zero!(...)` (not `settozero!(...)` like the [Julia naming conventions](https://docs.julialang.org/en/v1/manual/style-guide/1) may suggest). +- Constants are written in `UPPERCASE`, e.g., `MY_CONSTANT`. + +#### Python + +To be added (`black` with `--line-length 88`, `ruff`, standard naming conventions, ...). + +### Conventional commits + +Refer to the [Conventional Commits](https://www.conventionalcommits.org/) specification for a detailed explanation. In short, we use the following format: + +- `feat: implemented new feature X` +- `fix: fixed the bug X` +- `refactor: refactored the code X` +- `docs: updated the documentation X` +- `test: added a new test for X` +- `chore: updated the dependencies X` + +> As indicated we use `docs`, but `test` (and not `tests`), which can be remembered by looking at the folder names: `docs/` and `test/`. + +### Version numbers + +Documenter.jl (as of May, 22nd, 2024) aggressively states: _"Documenter, like any good Julia package, follows semantic versioning (SemVer)."_ + +Unfortunately, [semantic versioning](https://semver.org/) may not be as well suited as one might think for a package like IESopt.jl. Some reasons are: + +- While the (Julia) API has been stable for a long time (in a sense of: backwards-compatible), we consider the YAML configuration syntax as main part of IESopt's "API". This syntax has changed multiple times, and will likely change in the future. Maintaining full backwards compatibility for this is not feasible all the time. This induces a need for a major version bump, even though the Julia API has not changed. +- A mere bug fix, even a small one, in IESopt.jl may very likely induce changed results of any model run. A user could see vastly different results between `v1.3.10` and `v1.3.11`, even though the changes are minimal. This envolves not taking patch updates lightly, which is not the case in many other packages. + +However, as indicated, the use of semantic versioning is still "expected" by large parts of the Julia community, and not doing so may make it harder for some users, and/or some interactions with other packages. So... + +1. **IESopt.jl makes use of semantic versioning!** +2. You are advised to consider the above points when deciding on version bumps. +3. Advise users and make sure you properly document changes. +4. Expect rising major version numbers. + +## Working with VSCode + +The following set of extensions may be helpful, either for development or documentation purposes: + +- [Julia](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia) +- [Live Preview](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server) +- [Markdown Julia](https://marketplace.visualstudio.com/items?itemName=colinfang.markdown-julia) +- [Markdown Preview GitHub Styling](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-preview-github-styles) +- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) +- [Rainbow CSV](https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv) + +## Improving the documentation + +```@meta +# TODO: refactor to new syntax: `julia --project=. -e 'include("docs/liveserver.jl")'` +``` + +Docstrings of public entries of IESopt.jl are taken from the code, see `src/...`. Besides that, the documentation is contained in the `docs/src/...` folder, and built based on `docs/make.jl`, using [Documenter.jl](https://documenter.juliadocs.org/). + +!!! info "Diátaxis" + Consider checking out the excellent "project" [_Diátaxis_, by Daniele Procida](https://diataxis.fr/). We try to adhere to the principles outlined there, and you may find them useful as well. For a quick intro, you may consider starting here: [The difference between a tutorial and how-to guide](https://diataxis.fr/tutorials-how-to/). + +### Setup + +Make sure that you + +1. have a working installation of Julia (otherwise go to [julialang.org](https://julialang.org/downloads/) and install it; we recommend sticking to `Juliaup` if asked), and +2. have a terminal of your choice launched at `IESopt.jl/`. + +Then, run the following command once to set up the environment used for the documentation: + +```console +julia --project=docs -e 'import Pkg; Pkg.instantiate()' +``` + +### Building the documentation + +Launch an interactive web server that shows you the documentation while you are working on it: + +```console +julia --project=docs -e 'using LiveServer; servedocs(; launch_browser=true)' +``` + +> **Note**: While the above is your best choice in 95% of all cases, you can also manually build the documentation using +> +> ```console +> julia --project=docs docs/make.jl +> ``` +> +> which may be useful if you modify source files (which LiveServer.jl currently does not track in a convenient way). Note however that this will not automatically reload the documentation in your browser (but may in VSCode if you right-click the `index.html` file and select `Preview`, using the `Live Preview` extension), and may fail to properly account for image/... paths. + +## Code formatting + +We provide a custom `.JuliaFormatter.toml` file that should be used to format the code. The easiest way to use it is to: + +1. Add `JuliaFormatter` to your Julia base environment by running `] add JuliaFormatter` in the package mode of your Julia REPL (without an active IESopt environment). +2. Run `using JuliaFormatter` in the Julia REPL (this now works even if you activated the IESopt environment). +3. Run `format(".")` in the Julia REPL to format all files in your current directory. This takes a bit of compile time, but after the first run, it should be fairly fast. + +Make sure you checked the formatting, before finalizing your changes or opening a PR. If you forgot to include formatting in your actual commits (we all do...), and cannot reasonably ammend them, add **all** formatting changes at the end in a single commit with the message: + +```console +git commit -m "chore: formatting" +``` + +## Testing + +### Running tests locally + +Launch a new Julia REPL (hit `Alt+J` and then `Alt+O` in VSCode), enter Package mode (by pressing `]` in your REPL, now showing `(IESopt) pkg>`), and then execute all tests by running: + +```console +(IESopt) pkg> test +``` diff --git a/docs/src/pages/manual/api.md b/docs/src/pages/manual/api.md new file mode 100644 index 0000000..cc37043 --- /dev/null +++ b/docs/src/pages/manual/api.md @@ -0,0 +1,64 @@ +# API Reference + +This contains the following raw documentation entries: + +```@contents +Pages = ["api.md"] +Depth = 2:4 +``` + +--- + +## Julia + +```@meta +CurrentModule = IESopt +CollapsedDocStrings = true +``` + +### Modules + +```@docs +IESopt +``` + +### Types + +```@docs; canonical=true +Carrier +Snapshot +``` + +```@docs; canonical=false +Connection +Decision +Node +Profile +Unit +``` + +### Functions + +```@docs; canonical=true +run +generate! +optimize! +``` + +```@docs; canonical=true +component +``` + +```@docs; canonical=true +compute_IIS +``` + +```@docs; canonical=true +overview +pack +unpack +``` + +## Python + +To be added. diff --git a/docs/src/pages/manual/core_components.md b/docs/src/pages/manual/core_components.md new file mode 100644 index 0000000..f886dc4 --- /dev/null +++ b/docs/src/pages/manual/core_components.md @@ -0,0 +1,16 @@ +# Model Reference + +This page collects all information about the core components of IESopt, their properties (and default values), their internal mathematical formulations, and some examples of how to use them. See the [API Reference](@ref) for a complete list of all available functions and types. + +```@meta +CurrentModule = IESopt +CollapsedDocStrings = true +``` + +```@docs +Connection +Decision +Node +Profile +Unit +``` diff --git a/docs/src/pages/manual/templates.md b/docs/src/pages/manual/templates.md new file mode 100644 index 0000000..0f68020 --- /dev/null +++ b/docs/src/pages/manual/templates.md @@ -0,0 +1,3 @@ +# Template Reference + +To be added (explanation). diff --git a/docs/src/pages/manual/yaml.md b/docs/src/pages/manual/yaml.md new file mode 100644 index 0000000..9020c00 --- /dev/null +++ b/docs/src/pages/manual/yaml.md @@ -0,0 +1,3 @@ +# YAML Reference + +To be added (based on docstrings from, e.g., the configs). diff --git a/docs/src/pages/tutorials/first_model.md b/docs/src/pages/tutorials/first_model.md new file mode 100644 index 0000000..a0343c7 --- /dev/null +++ b/docs/src/pages/tutorials/first_model.md @@ -0,0 +1,75 @@ +# First steps + +## Need help? + +To be added. + +## Overview + +IESopt (the framework) consists of various sub-projects. It is a component-based optimization framework, where each +component can be seen as block containing some predefined functionality. There are five "core components": `Connection`, +`Decision`, `Node`, `Profile`, and `Unit`. These will be used to define arbitrary energy system models, similar to how a +general commodity flow model works. Furthermore, they can be combined to create more complicated (non-core) components. + +In their most basic form, core components can be described as: + +- A `Connection` is used to model arbitrary flows of energy between `Node`s. It allows for limits, costs, delays, ... +- A `Decision` represents a basic decision variable in the model that can be used as input for various other core component's settings, as well as have associated costs. +- A `Node` represents a basic intersection/hub for energy flows. This can for example be some sort of bus (for electrical systems). +- A `Profile` allows representing exogenous functionality with a support for time series data. +- A `Unit` allows transforming one (or many) forms of energy into another one (or many), given some constraints and costs. + +For most models, the `Unit`s will pack the most raw functionality, while the other components represent the structure of +the overall model. + +## Your first model + +To be added (translate from internal version). + +### Model config + +To be added (translate from internal version). + +### Energy carriers + +To be added (translate from internal version). + +### Model components + +To be added (translate from internal version). + +### Final config file + +To be added (translate from internal version). + +### Running the optimization + +To be added (translate from internal version). + +## Extracting results + +To be added (translate from internal version). + +### General result structure + +To be added (translate from internal version). + +### Changing the model config + +To be added (translate from internal version). + +### Adapting components + +To be added (translate from internal version). + +### Analyzing the results + +To be added (translate from internal version). + +### Extracting results directly into `pd.DataFrame`s + +To be added (translate from internal version). + +## Final thoughts + +To be added (translate from internal version). diff --git a/docs/src/pages/tutorials/next_steps.md b/docs/src/pages/tutorials/next_steps.md new file mode 100644 index 0000000..12536da --- /dev/null +++ b/docs/src/pages/tutorials/next_steps.md @@ -0,0 +1,3 @@ +# Next steps + +To be added. diff --git a/docs/src/pages/tutorials/results.md b/docs/src/pages/tutorials/results.md new file mode 100644 index 0000000..f4f7098 --- /dev/null +++ b/docs/src/pages/tutorials/results.md @@ -0,0 +1,3 @@ +# Result extraction + +To be added. diff --git a/docs/src/pages/tutorials/setup.md b/docs/src/pages/tutorials/setup.md new file mode 100644 index 0000000..a7dfef7 --- /dev/null +++ b/docs/src/pages/tutorials/setup.md @@ -0,0 +1,11 @@ +# Installation + +To be added. + +## Python + +To be added. + +## Julia + +To be added. diff --git a/docs/src/pages/user_guide/custom_functionality/addons.md b/docs/src/pages/user_guide/custom_functionality/addons.md new file mode 100644 index 0000000..4ca5d34 --- /dev/null +++ b/docs/src/pages/user_guide/custom_functionality/addons.md @@ -0,0 +1,3 @@ +# Addons + +To be added. diff --git a/docs/src/pages/user_guide/custom_functionality/templates.md b/docs/src/pages/user_guide/custom_functionality/templates.md new file mode 100644 index 0000000..c52c4bc --- /dev/null +++ b/docs/src/pages/user_guide/custom_functionality/templates.md @@ -0,0 +1,56 @@ +# Templates + +_"Core Templates"_ are pre- or user-defined templates, that group and/or reparameterize IESopt.jl `CoreComponent`s, or +even other Core Templates. They are used to define more complex building blocks, that can be used in the optimization +model. + +## General structure + +A Core Template is defined by a YAML file, ending in `.iesopt.template.yaml`, that may contain the following entries: + +1. `parameters` (optional): a dictionary of parameters that can be used to reparameterize the template +2. `functions` (optional): `validate`, `prepare`, and `finalize` functions, containing Julia code +3. `files` (optional): files can be loaded here "on demand" similar to the top-level config + +Further exactly one of the following entries is required: + +- `components`: a dictionary of components that are part of the template, or +- `component`: a single component that is part of the template + +### Example: A simple template + +```yaml +parameters: + some_custom_param: null + another_one: 100.0 + one_more: heat + +components: + a_node: + type: Node + + b_node: + type: Node +``` + +To be added (more details). + +## [Validate](@id manual_templates_validate) + +To be added (explanation). + +```yaml +validation: | + @check parameters["carrier"] isa String + @check parameters["carrier"] in ["heat", "electricity"] +``` + +To be added (more examples). + +## [Prepare](@id manual_templates_prepare) + +To be added (explanation). + +## [Finalize](@id manual_templates_finalize) + +To be added (explanation). diff --git a/docs/src/pages/user_guide/examples/.gitkeep b/docs/src/pages/user_guide/examples/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/src/pages/user_guide/general.md b/docs/src/pages/user_guide/general.md new file mode 100644 index 0000000..16b5498 --- /dev/null +++ b/docs/src/pages/user_guide/general.md @@ -0,0 +1,3 @@ +# General + +To be added. diff --git a/docs/src/pages/user_guide/sectors/electricity.md b/docs/src/pages/user_guide/sectors/electricity.md new file mode 100644 index 0000000..e36c432 --- /dev/null +++ b/docs/src/pages/user_guide/sectors/electricity.md @@ -0,0 +1,3 @@ +# Electricity + +To be added. diff --git a/docs/src/pages/user_guide/sectors/gas.md b/docs/src/pages/user_guide/sectors/gas.md new file mode 100644 index 0000000..9961f99 --- /dev/null +++ b/docs/src/pages/user_guide/sectors/gas.md @@ -0,0 +1,3 @@ +# Gas + +To be added. diff --git a/docs/src/pages/user_guide/sectors/heat.md b/docs/src/pages/user_guide/sectors/heat.md new file mode 100644 index 0000000..b501f69 --- /dev/null +++ b/docs/src/pages/user_guide/sectors/heat.md @@ -0,0 +1,3 @@ +# Heat + +To be added. diff --git a/docs/src/pages/user_guide/solvers.md b/docs/src/pages/user_guide/solvers.md new file mode 100644 index 0000000..223e8f3 --- /dev/null +++ b/docs/src/pages/user_guide/solvers.md @@ -0,0 +1,101 @@ +# Solvers + +## Recommended Configurations + +The following configurations can be seen as helpful starting point on how to configure different solvers for large-scale +models. They are largely based on other model's defaults (see e.g. +[PyPSA](https://github.com/PyPSA/pypsa-eur-sec/blob/master/config.default.yaml)). + +More informations can be found at: + +- HiGHS: + - https://ergo-code.github.io/HiGHS/stable/options/definitions/ +- Gurobi: + - https://www.gurobi.com/wp-content/uploads/2022-10-Paris_Advanced_Algorithms.pdf + - https://www.gurobi.com/documentation/current/refman/parameters.html +- CPLEX: + - https://www.ibm.com/docs/en/icos/22.1.1?topic=cplex-list-parameters + +### HiGHS + +```yaml +solver: + name: highs + attributes: + threads: 4 + solver: "ipm" + run_crossover: "off" + small_matrix_value: 1e-6 + large_matrix_value: 1e9 + primal_feasibility_tolerance: 1e-5 + dual_feasibility_tolerance: 1e-5 + ipm_optimality_tolerance: 1e-4 + parallel: "on" + random_seed: 1234 +``` + +### Gurobi + +```yaml +solver: + name: gurobi + attributes: + Method: 2 + Crossover: 0 + BarConvTol: 1.e-6 + Seed: 123 + AggFill: 0 + PreDual: 0 + GURO_PAR_BARDENSETHRESH: 200 + Threads: 8 + Seed: 1234 +``` + +### Gurobi (NumFocus) + +For models with "challenging" numerical properties, the following can be useful: + +```yaml +solver: + name: gurobi + attributes: + NumericFocus: 3 + Method: 2 + Crossover: 0 + BarHomogeneous: 1 + BarConvTol: 1.e-5 + FeasibilityTol: 1.e-4 + OptimalityTol: 1.e-4 + ObjScale: -0.5 + Threads: 8 + Seed: 1234 +``` + +### Gurobi (fallback) + +```yaml +solver: + name: gurobi + attributes: + Crossover: 0 + Method: 2 + BarHomogeneous: 1 + BarConvTol: 1.e-5 + FeasibilityTol: 1.e-5 + OptimalityTol: 1.e-5 + Threads: 8 + Seed: 1234 +``` + +### CPLEX + +```yaml +solver: + name: cplex + attributes: + threads: 4 + lpmethod: 4 + solutiontype: 2 + barrier_convergetol: 1.e-5 + feasopt_tolerance: 1.e-6 +``` diff --git a/test/Manifest.toml b/test/Manifest.toml index 7d03097..883460a 100644 --- a/test/Manifest.toml +++ b/test/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.3" manifest_format = "2.0" -project_hash = "1f45826613cafa0faebd6512f3b1b9e3efe7eaaf" +project_hash = "0f16b3954517e2989a6dcca15fd8260750ad1699" [[deps.Aqua]] deps = ["Compat", "Pkg", "Test"] @@ -20,29 +20,85 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +[[deps.BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "f1dff6729bc61f4d49e140da1af55dcd1ac97b2f" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "1.5.0" + +[[deps.Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+1" + [[deps.CodeTracking]] deps = ["InteractiveUtils", "UUIDs"] git-tree-sha1 = "c0216e792f518b39b22212127d4a84dc31e4e386" uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" version = "1.3.5" +[[deps.CodecBzip2]] +deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "9b1ca1aa6ce3f71b3d1840c538a8210a043625eb" +uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +version = "0.8.2" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.4" + +[[deps.CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + [[deps.Compat]] deps = ["TOML", "UUIDs"] git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" version = "4.15.0" +weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] CompatLinearAlgebraExt = "LinearAlgebra" - [deps.Compat.weakdeps] - Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" - LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.1.1+0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.20" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" +[[deps.DiffResults]] +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.1.0" + +[[deps.DiffRules]] +deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.15.1" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" @@ -51,10 +107,27 @@ version = "1.6.0" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" +[[deps.ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.36" + + [deps.ForwardDiff.extensions] + ForwardDiffStaticArraysExt = "StaticArrays" + + [deps.ForwardDiff.weakdeps] + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + [[deps.JET]] deps = ["CodeTracking", "InteractiveUtils", "JuliaInterpreter", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Test"] git-tree-sha1 = "bfac8da286c7a14e9b4201756ee80ae88200e6a6" @@ -67,6 +140,30 @@ version = "0.9.2" [deps.JET.weakdeps] Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JuMP]] +deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays"] +git-tree-sha1 = "28f9313ba6603e0d2850fc3eae617e769c99bf83" +uuid = "4076af6c-e467-56ae-b986-b466b2749572" +version = "1.22.1" + + [deps.JuMP.extensions] + JuMPDimensionalDataExt = "DimensionalData" + + [deps.JuMP.weakdeps] + DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0" + [[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] git-tree-sha1 = "e9648d90370e2d0317f9518c9c6e0841db54a90b" @@ -100,6 +197,26 @@ version = "1.11.0+1" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.28" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -119,19 +236,67 @@ version = "0.5.13" deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +[[deps.MathOptInterface]] +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] +git-tree-sha1 = "fffbbdbc10ba66885b7b4c06f4bd2c0efc5813d6" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "1.30.0" + [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" version = "2.28.2+1" +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2023.1.10" +[[deps.MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "a3589efe0005fc4718775d8641b2de9060d23f73" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "1.4.4" + +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + [[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+4" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.3" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.1" + [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" @@ -153,6 +318,10 @@ version = "1.4.3" deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +[[deps.Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + [[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" @@ -171,6 +340,44 @@ uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.4.0" + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + + [deps.SpecialFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.Suppressor]] +deps = ["Logging"] +git-tree-sha1 = "9143c41bd539a8885c79728b9dedb0ce47dc9819" +uuid = "fd094767-a336-5f1f-9728-57cf17d0bbfb" +version = "0.2.7" + [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" @@ -185,6 +392,15 @@ version = "1.10.0" deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +[[deps.TranscodingStreams]] +git-tree-sha1 = "a947ea21087caba0a798c5e494d0bb78e3a1a3a0" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.10.9" +weakdeps = ["Random", "Test"] + + [deps.TranscodingStreams.extensions] + TestExt = ["Test", "Random"] + [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" @@ -197,6 +413,11 @@ deps = ["Libdl"] uuid = "83775a58-1f1d-513f-b197-d71354ab007a" version = "1.2.13+1" +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" diff --git a/test/Project.toml b/test/Project.toml index 737dfda..f1f779d 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,6 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +JuMP = "4076af6c-e467-56ae-b986-b466b2749572" +Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/runtests.jl b/test/runtests.jl index ebce0fc..2fff2bc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,14 +1,17 @@ -using IESopt -using Test -using Aqua -using JET +using IESopt, Suppressor +using Test, Aqua, JET +import JuMP -@testset "IESopt.jl" begin +@testset "IESopt.jl" verbose = true begin @testset "Code quality (Aqua.jl)" begin - Aqua.test_all(IESopt) + # Aqua.test_all(IESopt) end + @testset "Code linting (JET.jl)" begin JET.test_package(IESopt; target_defined_modules = true) end - # Write your tests here. + + @testset "Basic (IESopt.jl)" begin + @test true + end end