Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ac/package updates #2

Merged
Merged
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
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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/)
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "SIENNA-Package"
name = "SiennaTemplate"
uuid = "bed98974-b02a-5e2f-9ee0-a103f5c450dd"
authors = ["YOUR_NAME"]
version = "0.1.0"
Expand Down
5 changes: 4 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -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"

annacasavant marked this conversation as resolved.
Show resolved Hide resolved
[compat]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a requirement for:
Documenter = "1"

Documenter = "0.27"
julia = "^1.6"
Documenter = "^1.0"
65 changes: 38 additions & 27 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -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"
],
)
annacasavant marked this conversation as resolved.
Show resolved Hide resolved

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#.#"],
)

1 change: 1 addition & 0 deletions docs/src/explanation/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Explanation](https://diataxis.fr/explanation/) section of the diataxis framework.
1 change: 1 addition & 0 deletions docs/src/how_to_guides/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [How-to-Guides](https://diataxis.fr/how-to-guides/) section of the diataxis framework.
27 changes: 20 additions & 7 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 0 additions & 3 deletions docs/src/quick_start_guide.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/src/reference/developer_guidelines.md
Original file line number Diff line number Diff line change
@@ -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%**
12 changes: 6 additions & 6 deletions docs/src/api/internal.md → docs/src/reference/internal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Internal API

```@autodocs
Modules = [SIENNA-Package]
Public = false
```
# Internal API
```@autodocs
Modules = [SiennaTemplate]
Public = false
```
12 changes: 6 additions & 6 deletions docs/src/api/public.md → docs/src/reference/public.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Public API Reference

```@autodocs
Modules = [SIENNA-Package]
Public = true
```
# Public API Reference
```@autodocs
Modules = [SiennaTemplate]
Public = true
```
1 change: 1 addition & 0 deletions docs/src/reference/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Reference](https://diataxis.fr/reference/) section of the diataxis framework.
1 change: 1 addition & 0 deletions docs/src/tutorials/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Tutorial](https://diataxis.fr/tutorials/) section of the diataxis framework.
69 changes: 28 additions & 41 deletions scripts/formatter/formatter_code.jl
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions src/SIIP-PACKAGE.jl → src/SiennaTemplate.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module SIENNA
-PACKAGE

module SiennaTemplate
using DocStringExtensions

@template (FUNCTIONS, METHODS) = """
Expand Down
16 changes: 8 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Loading