Skip to content

Commit

Permalink
Format codebase and add format check to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Apr 3, 2024
1 parent 9d4b145 commit 4956f61
Show file tree
Hide file tree
Showing 156 changed files with 10,362 additions and 8,118 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "sciml"
9 changes: 9 additions & 0 deletions .github/workflows/format_suggestions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Format suggestions
on:
pull_request:

jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/julia-format@v2
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
introduce this parameter as cost of virtual charging and discharging to avoid unusual results (#608).
- New settings parameter, StorageVirtualDischarge, to turn storage virtual charging and discharging off if desired by the user (#638).
- Add module to retrofit existing resources with new technologies (#600).
- Formatted the code and added a format check to the CI pipeline (#673).

### Fixed
- Set MUST_RUN=1 for RealSystemExample/small_hydro plants (#517).
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<div align="center"> <img src="docs/src/assets/logo_readme.svg" height ="200"width="1000" alt="GenX.jl"></img></div>

[![CI](https://github.com/GenXProject/GenX/actions/workflows/ci.yml/badge.svg)](https://github.com/GenXProject/GenX/actions/workflows/ci.yml)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://genxproject.github.io/GenX.jl/dev)
[![DOI](https://zenodo.org/badge/368957308.svg)](https://zenodo.org/doi/10.5281/zenodo.10846069)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
| **Documentation** | **DOI** |
|:-------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------:|
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://genxproject.github.io/GenX.jl/stable/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://genxproject.github.io/GenX.jl/dev) | [![DOI](https://zenodo.org/badge/368957308.svg)](https://zenodo.org/doi/10.5281/zenodo.10846069)

[![CI](https://github.com/GenXProject/GenX/actions/workflows/ci.yml/badge.svg)](https://github.com/GenXProject/GenX/actions/workflows/ci.yml) [![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle) [![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)

## Overview
GenX is a highly-configurable, [open source](https://github.com/GenXProject/GenX/blob/main/LICENSE) electricity resource capacity expansion model
Expand Down
51 changes: 22 additions & 29 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ using Documenter
using GenX
import DataStructures: OrderedDict

DocMeta.setdocmeta!(GenX, :DocTestSetup, :(using GenX); recursive=true)
DocMeta.setdocmeta!(GenX, :DocTestSetup, :(using GenX); recursive = true)

pages = OrderedDict(
"Welcome Page" => [
pages = OrderedDict("Welcome Page" => [
"GenX: Introduction" => "index.md",
"Installation Guide" => "installation.md",
"Limitation of GenX" => "limitations_genx.md",
"Third Party Extensions" => "third_party_genx.md"
"Third Party Extensions" => "third_party_genx.md",
],
"Getting Started" => [
"Running GenX" => "Getting_Started/examples_casestudies.md",
Expand Down Expand Up @@ -51,7 +50,7 @@ pages = OrderedDict(
"Flexible Demand" => "Model_Reference/Resources/flexible_demand.md",
"Hydro" => [
"Hydro Reservoir" => "Model_Reference/Resources/hydro_res.md",
"Long Duration Hydro" => "Model_Reference/Resources/hydro_inter_period_linkage.md"
"Long Duration Hydro" => "Model_Reference/Resources/hydro_inter_period_linkage.md",
],
"Must Run" => "Model_Reference/Resources/must_run.md",
"Retrofit" => "Model_Reference/Resources/retrofit.md",
Expand All @@ -62,18 +61,18 @@ pages = OrderedDict(
"Long Duration Storage" => "Model_Reference/Resources/long_duration_storage.md",
"Storage All" => "Model_Reference/Resources/storage_all.md",
"Storage Asymmetric" => "Model_Reference/Resources/storage_asymmetric.md",
"Storage Symmetric" => "Model_Reference/Resources/storage_symmetric.md"
"Storage Symmetric" => "Model_Reference/Resources/storage_symmetric.md",
],
"Co-located VRE and Storage" => "Model_Reference/Resources/vre_stor.md",
"Thermal" => [
"Thermal" => "Model_Reference/Resources/thermal.md",
"Thermal Commit" => "Model_Reference/Resources/thermal_commit.md",
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md"
"Thermal No Commit" => "Model_Reference/Resources/thermal_no_commit.md",
],
"Hydrogen Electrolyzers" => "Model_Reference/Resources/electrolyzers.md",
"Retrofit" => "Model_Reference/Resources/retrofit.md",
"Scheduled maintenance for various resources" => "Model_Reference/Resources/maintenance.md",
"Resource types" => "Model_Reference/Resources/resource.md"
"Resource types" => "Model_Reference/Resources/resource.md",
],
"Maintenance" => "Model_Reference/maintenance_overview.md",
"Policies" => "Model_Reference/policies.md",
Expand All @@ -88,46 +87,40 @@ pages = OrderedDict(
"Multi-Stage Modeling Introduction" => "Model_Reference/Multi_Stage/multi_stage_overview.md",
"Configure multi-stage inputs" => "Model_Reference/Multi_Stage/configure_multi_stage_inputs.md",
"Model multi stage: Dual Dynamic Programming Algorithm" => "Model_Reference/Multi_Stage/dual_dynamic_programming.md",
"Endogenous Retirement" => "Model_Reference/Multi_Stage/endogenous_retirement.md"
"Endogenous Retirement" => "Model_Reference/Multi_Stage/endogenous_retirement.md",
],
"Method of Morris" => "Model_Reference/methodofmorris.md",
"Utility Functions" => "Model_Reference/utility_functions.md",
],
"Public API Reference" => [
"Public API" => "Public_API/public_api.md",

],
"Public API" => "Public_API/public_api.md"],
"Third Party Extensions" => "additional_third_party_extensions.md",
"Developer Docs" => "developer_guide.md",
)
"Developer Docs" => "developer_guide.md")

# Build documentation.
# ====================

makedocs(;
modules=[GenX],
authors="Jesse Jenkins, Nestor Sepulveda, Dharik Mallapragada, Aaron Schwartz, Neha Patankar, Qingyu Xu, Jack Morris, Sambuddha Chakrabarti",
sitename="GenX.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://genxproject.github.io/GenX.jl/stable",
modules = [GenX],
authors = "Jesse Jenkins, Nestor Sepulveda, Dharik Mallapragada, Aaron Schwartz, Neha Patankar, Qingyu Xu, Jack Morris, Sambuddha Chakrabarti",
sitename = "GenX.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://genxproject.github.io/GenX.jl/stable",
assets = ["assets/genx_style.css"],
sidebar_sitename=false,
collapselevel=1
),
pages=[p for p in pages]
)
sidebar_sitename = false,
collapselevel = 1),
pages = [p for p in pages])

# Deploy built documentation.
# ===========================

deploydocs(;
repo="github.com/GenXProject/GenX.jl.git",
repo = "github.com/GenXProject/GenX.jl.git",
target = "build",
branch = "gh-pages",
devbranch = "main",
devurl = "dev",
push_preview=true,
push_preview = true,
versions = ["stable" => "v^", "v#.#.#", "dev" => "dev"],
forcepush = false,
)
forcepush = false)
2 changes: 1 addition & 1 deletion example_systems/1_three_zones/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
2 changes: 1 addition & 1 deletion example_systems/2_three_zones_w_electrolyzer/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
2 changes: 1 addition & 1 deletion example_systems/3_three_zones_w_co2_capture/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
2 changes: 1 addition & 1 deletion example_systems/4_three_zones_w_policies_slack/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
2 changes: 1 addition & 1 deletion example_systems/6_three_zones_w_multistage/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
2 changes: 1 addition & 1 deletion example_systems/9_IEEE_9_bus_DC_OPF/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using GenX

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__))
Loading

0 comments on commit 4956f61

Please sign in to comment.