diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7cb4af8..a3f8f21 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,5 @@ -Thanks for opening a PR to SIENNA-PACKAGE.jl, please take note of the following when making a PR: +Thanks for opening a PR to SiennaTemplate.jl, please take note of the following when making a PR: + +Check the [contributor guidelines](https://nrel-sienna.github.io/SiennaTemplate.jl/stable/api/developer_guidelines/) + -Check the [contributor guidelines](https://nrel-siip.github.io/SIENNA-PACKAGE.jl/stable/code_base_developer_guide/developer/) diff --git a/Project.toml b/Project.toml index 0b3d6c2..8999b29 100644 --- a/Project.toml +++ b/Project.toml @@ -1,4 +1,4 @@ -name = "SIENNA-Package" +name = "SiennaTemplate" uuid = "bed98974-b02a-5e2f-9ee0-a103f5c450dd" authors = ["YOUR_NAME"] version = "0.1.0" diff --git a/docs/Project.toml b/docs/Project.toml index 3cc884d..7da88df 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,9 @@ [deps] +DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" +SiennaTemplate = "bed98974-b02a-5e2f-9ee0-a103f5c450dd" [compat] -Documenter = "0.27" julia = "^1.6" +Documenter = "^1.0" diff --git a/docs/make.jl b/docs/make.jl index a6ef624..601db43 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,27 +1,38 @@ -using Documenter, SIENNA - PACKAGE - -pages = OrderedDict( - "Welcome Page" => "index.md", - "Quick Start Guide" => "quick_start_guide.md", - "Tutorials" => "tutorials/intro_page.md", - "Public API Reference" => "api/public.md", - "Internal API Reference" => "api/internal.md", -) - -makedocs( - modules=[SIENNA-PACKAGE], - format=Documenter.HTML(prettyurls=haskey(ENV, "GITHUB_ACTIONS")), - sitename="SIENNA-PACKAGE.jl", - authors="Freddy Mercury, Nikola Tesla, Leonard Bernestein", - pages=Any[p for p in pages], -) - -deploydocs( - repo="github.com/NREL-SIENNA/SIENNA-PACKAGE.git", - target="build", - branch="gh-pages", - devbranch="main", - devurl="dev", - push_preview=true, - versions=["stable" => "v^", "v#.#"], -) +using Documenter +import DataStructures: OrderedDict +using SiennaTemplate + +pages = OrderedDict( + "Welcome Page" => "index.md", + "Tutorials" => Any["stub" => "tutorials/stub.md"], + "How to..." => Any["stub" => "how_to_guides/stub.md"], + "Explanation" => Any["stub" => "explanation/stub.md"], + "Reference" => Any[ + "Developers" => ["Developer Guidelines" => "reference/developer_guidelines.md", + "Internals" => "reference/internal.md"], + "Public API" => "reference/public.md", + "Stub" => "reference/stub.md" + ], +) + +makedocs( + modules = [SiennaTemplate], + format = Documenter.HTML( + prettyurls = haskey(ENV, "GITHUB_ACTIONS"), + size_threshold = nothing,), + sitename = "github.com/NREL-Sienna/SiennaTemplate.jl", + authors = "Freddy Mercury", + pages = Any[p for p in pages], + draft = false, +) + +deploydocs( + repo="github.com/NREL-Sienna/SiennaTemplate.jl", + target="build", + branch="gh-pages", + devbranch="main", + devurl="dev", + push_preview=true, + versions=["stable" => "v^", "v#.#"], +) + diff --git a/docs/src/explanation/stub.md b/docs/src/explanation/stub.md new file mode 100644 index 0000000..979e4f0 --- /dev/null +++ b/docs/src/explanation/stub.md @@ -0,0 +1 @@ +Please refer to the [Explanation](https://diataxis.fr/explanation/) section of the diataxis framework. diff --git a/docs/src/how_to_guides/stub.md b/docs/src/how_to_guides/stub.md new file mode 100644 index 0000000..c275f8c --- /dev/null +++ b/docs/src/how_to_guides/stub.md @@ -0,0 +1 @@ +Please refer to the [How-to-Guides](https://diataxis.fr/how-to-guides/) section of the diataxis framework. diff --git a/docs/src/index.md b/docs/src/index.md index fc880bd..73eed1b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,14 +1,27 @@ -# PowerSystems.jl +# SiennaTemplate.jl ```@meta -CurrentModule = SIENNA_PACKAGE +CurrentModule = SiennaTemplate ``` ## Overview -`PSIENNA-PACKAGE .jl` is a [`Julia`](http://www.julialang.org) package that provides blah blah +`SiennaTemplate.jl` is a [`Julia`](http://www.julialang.org) package that provides blah blah ------------- -SIENNA-PACKAGE has been developed as part of the Scalable Integrated Infrastructure Planning -(SIENNA) initiative at the U.S. Department of Energy's National Renewable Energy -Laboratory ([NREL](https://www.nrel.gov/)). +## About + +`SiennaTemplate` is part of the National Renewable Energy Laboratory's +[Sienna ecosystem](https://www.nrel.gov/analysis/sienna.html), an open source framework for +scheduling problems and dynamic simulations for power systems. The Sienna ecosystem can be +[found on github](https://github.com/NREL-Sienna/Sienna). It contains three applications: + + - [Sienna\Data](https://github.com/NREL-Sienna/Sienna?tab=readme-ov-file#siennadata) enables + efficient data input, analysis, and transformation + - [Sienna\Ops](https://github.com/NREL-Sienna/Sienna?tab=readme-ov-file#siennaops) enables + enables system scheduling simulations by formulating and solving optimization problems + - [Sienna\Dyn](https://github.com/NREL-Sienna/Sienna?tab=readme-ov-file#siennadyn) enables + system transient analysis including small signal stability and full system dynamic + simulations + +Each application uses multiple packages in the [`Julia`](http://www.julialang.org) +programming language. diff --git a/docs/src/quick_start_guide.md b/docs/src/quick_start_guide.md deleted file mode 100644 index 83ee5ed..0000000 --- a/docs/src/quick_start_guide.md +++ /dev/null @@ -1,3 +0,0 @@ -# Quick Start Guide - -SIENNA-PACKAGE.jl is structured to enable stuff diff --git a/docs/src/reference/developer_guidelines.md b/docs/src/reference/developer_guidelines.md new file mode 100644 index 0000000..7740781 --- /dev/null +++ b/docs/src/reference/developer_guidelines.md @@ -0,0 +1,12 @@ +# Developer Guidelines + +In order to contribute to `PowerSystems.jl` repository please read the following sections of +[`InfrastructureSystems.jl`](https://github.com/NREL-Sienna/InfrastructureSystems.jl) +documentation in detail: + + 1. [Style Guide](https://nrel-sienna.github.io/InfrastructureSystems.jl/stable/style/) + 2. [Contributing Guidelines](https://github.com/NREL-Sienna/SiennaTemplate.jl/blob/main/CONTRIBUTING.md) + +Pull requests are always welcome to fix bugs or add additional modeling capabilities. + +**All the code contributions need to include tests with a minimum coverage of 70%** diff --git a/docs/src/api/internal.md b/docs/src/reference/internal.md similarity index 55% rename from docs/src/api/internal.md rename to docs/src/reference/internal.md index 740d710..88de2b8 100644 --- a/docs/src/api/internal.md +++ b/docs/src/reference/internal.md @@ -1,6 +1,6 @@ -# Internal API - -```@autodocs -Modules = [SIENNA-Package] -Public = false -``` +# Internal API + +```@autodocs +Modules = [SiennaTemplate] +Public = false +``` \ No newline at end of file diff --git a/docs/src/api/public.md b/docs/src/reference/public.md similarity index 59% rename from docs/src/api/public.md rename to docs/src/reference/public.md index 3e9e7ed..10802a1 100644 --- a/docs/src/api/public.md +++ b/docs/src/reference/public.md @@ -1,6 +1,6 @@ -# Public API Reference - -```@autodocs -Modules = [SIENNA-Package] -Public = true -``` +# Public API Reference + +```@autodocs +Modules = [SiennaTemplate] +Public = true +``` \ No newline at end of file diff --git a/docs/src/reference/stub.md b/docs/src/reference/stub.md new file mode 100644 index 0000000..4ea916c --- /dev/null +++ b/docs/src/reference/stub.md @@ -0,0 +1 @@ +Please refer to the [Reference](https://diataxis.fr/reference/) section of the diataxis framework. diff --git a/docs/src/tutorials/stub.md b/docs/src/tutorials/stub.md new file mode 100644 index 0000000..defee0b --- /dev/null +++ b/docs/src/tutorials/stub.md @@ -0,0 +1 @@ +Please refer to the [Tutorial](https://diataxis.fr/tutorials/) section of the diataxis framework. diff --git a/scripts/formatter/formatter_code.jl b/scripts/formatter/formatter_code.jl index 2caa269..3a1f434 100644 --- a/scripts/formatter/formatter_code.jl +++ b/scripts/formatter/formatter_code.jl @@ -1,41 +1,28 @@ -using Pkg -Pkg.activate(@__DIR__) -Pkg.instantiate() -using JuliaFormatter - -main_paths = [".", "./docs/src"] -for main_path in main_paths - format( - main_path; - whitespace_ops_in_indices=true, - remove_extra_newlines=true, - verbose=true, - always_for_in=true, - whitespace_typedefs=true, - whitespace_in_kwargs=false, - format_docstrings=true, - always_use_return=false, # removed since it has false positives. - ) -end - -# Documentation Formatter -main_paths = ["./docs/src"] -for main_path in main_paths - for folder in readdir(main_path) - @show folder_path = joinpath(main_path, folder) - if isfile(folder_path) - !occursin(".md", folder_path) && continue - end - format( - folder_path; - format_markdown=true, - whitespace_ops_in_indices=true, - remove_extra_newlines=true, - verbose=true, - always_for_in=true, - whitespace_typedefs=true, - whitespace_in_kwargs=false, - # always_use_return = true # removed since it has false positives. - ) - end -end +using Pkg +Pkg.activate(@__DIR__) +Pkg.instantiate() +using JuliaFormatter + +main_paths = ["./src", "./test", "./docs/src"] +for main_path in main_paths + for (root, dir, files) in walkdir(main_path) + for f in files + @show file_path = abspath(root, f) + !((occursin(".jl", f) || occursin(".md", f))) && continue + format(file_path; + whitespace_ops_in_indices = true, + remove_extra_newlines = true, + verbose = true, + always_for_in = true, + whitespace_typedefs = true, + conditional_to_if = true, + join_lines_based_on_source = true, + separate_kwargs_with_semicolon = true, + format_markdown = true, + #ignore = [] # list of file that cause formatter to error + + # always_use_return = true. # Disabled since it throws a lot of false positives + ) + end + end +end diff --git a/src/SIIP-PACKAGE.jl b/src/SiennaTemplate.jl similarity index 89% rename from src/SIIP-PACKAGE.jl rename to src/SiennaTemplate.jl index 6943f34..bfff18b 100644 --- a/src/SIIP-PACKAGE.jl +++ b/src/SiennaTemplate.jl @@ -1,6 +1,4 @@ -module SIENNA --PACKAGE - +module SiennaTemplate using DocStringExtensions @template (FUNCTIONS, METHODS) = """ diff --git a/test/runtests.jl b/test/runtests.jl index 865797e..e720095 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,11 +2,11 @@ using Test import Logging import Aqua -Aqua.test_unbound_args(SIENNA - PACKAGE) -Aqua.test_undefined_exports(SIENNA - PACKAGE) -Aqua.test_ambiguities(SIENNA - PACKAGE) -Aqua.test_stale_deps(SIENNA - PACKAGE) -Aqua.test_deps_compat(SIENNA - PACKAGE) +Aqua.test_unbound_args(SiennaTemplate) +Aqua.test_undefined_exports(SiennaTemplate) +Aqua.test_ambiguities(SiennaTemplate) +Aqua.test_stale_deps(SiennaTemplate) +Aqua.test_deps_compat(SiennaTemplate) LOG_FILE = "power-systems.log" LOG_LEVELS = Dict( @@ -69,9 +69,9 @@ function run_tests() config = IS.LoggingConfiguration(logging_config_filename) else config = IS.LoggingConfiguration(; - filename=LOG_FILE, - file_level=Logging.Info, - console_level=Logging.Error, + filename = LOG_FILE, + file_level = Logging.Info, + console_level = Logging.Error, ) end console_logger = ConsoleLogger(config.console_stream, config.console_level)