Skip to content

Commit

Permalink
fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
annacasavant committed Nov 26, 2024
2 parents 0f52863 + fd75f7a commit 3649d2d
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 140 deletions.
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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/)


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/)


4 changes: 2 additions & 2 deletions .github/workflows/cross-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CrossPackageTest

on:
push:
branches: [master]
branches: [main]
tags: [v*]
pull_request:

Expand All @@ -26,7 +26,7 @@ jobs:
- name: Clone ${{matrix.package_name}}
uses: actions/checkout@v2
with:
repository: NREL-SIIP/${{matrix.package_name}}.jl
repository: NREL-SIENNA/${{matrix.package_name}}.jl
path: downstream
- name: Run the tests
shell: julia --project=downstream {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Documentation
on:
push:
branches:
- master
- main
- 'release-'
tags: '*'
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Format Check
on:
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Community driven development of this package is encouraged. To maintain code quality standards, please adhere to the following guidlines when contributing:
- To get started, <a href="https://www.clahub.com/agreements/NREL/SIIP-PACKAGE.jl">sign the Contributor License Agreement</a>.
- To get started, <a href="https://www.clahub.com/agreements/NREL/SIENNA-PACKAGE.jl">sign the Contributor License Agreement</a>.
- Please do your best to adhere to our [coding style guide](docs/src/developer/style.md).
- To submit code contributions, [fork](https://help.github.com/articles/fork-a-repo/) the repository, commit your changes, and [submit a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SIIP-Template
# SIENNA-Template

[![Master - CI](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/workflows/Master%20-%20CI/badge.svg)](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/actions/workflows/main-tests.yml)
[![codecov](https://codecov.io/gh/NREL-Sienna/Sienna-PACKAGE.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/NREL-SIIP/SIIP-PACKAGE.jl)
[![main - CI](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/workflows/main%20-%20CI/badge.svg)](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/actions/workflows/main-tests.yml)
[![codecov](https://codecov.io/gh/NREL-Sienna/Sienna-PACKAGE.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/NREL-SIENNA/SIENNA-PACKAGE.jl)
[![Documentation Build](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/workflows/Documentation/badge.svg?)](https://nrel-sienna.github.io/Sienna-PACKAGE.jl/stable)
[<img src="https://img.shields.io/badge/slack-@Sienna/SiennaPACKAGE-sienna.svg?logo=slack">](https://join.slack.com/t/nrel-siip/shared_invite/zt-glam9vdu-o8A9TwZTZqqNTKHa7q3BpQ)
[![Sienna-PACKAGE.jl Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/SIIP-PACKAGE)](https://pkgs.genieframework.com?packages=Sienna-PACKAGE)
[![Sienna-PACKAGE.jl Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/SIENNA-PACKAGE)](https://pkgs.genieframework.com?packages=Sienna-PACKAGE)


This repository contains the template files for a dummy package called SIIP-PACKAGE. IT contains the required files for
This repository contains the template files for a dummy package called SIENNA-PACKAGE. IT contains the required files for

- Testing
- Documentation
Expand All @@ -16,8 +16,8 @@ This repository contains the template files for a dummy package called SIIP-PACK

## Development

Contributions to the development and enahancement of Sienna-PACKAGE is welcome. Please see [CONTRIBUTING.md](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/blob/master/CONTRIBUTING.md) for code contribution guidelines.
Contributions to the development and enahancement of Sienna-PACKAGE is welcome. Please see [CONTRIBUTING.md](https://github.com/NREL-Sienna/Sienna-PACKAGE.jl/blob/main/CONTRIBUTING.md) for code contribution guidelines.

## License

SIIP-PACKAGE is released under a BSD [license](https://github.com/NREL/SIIP-PACKAGE/blob/master/LICENSE). Sienna PACKAGE has been developed as part of A PROJECT at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/))
SIENNA-PACKAGE is released under a BSD [license](https://github.com/NREL/SIENNA-PACKAGE/blob/main/LICENSE). Sienna PACKAGE has been developed as part of A PROJECT at the U.S. Department of Energy's National Renewable Energy Laboratory ([NREL](https://www.nrel.gov/))
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ deploydocs(
repo="github.com/NREL-Sienna/SiennaTemplate.jl",
target="build",
branch="gh-pages",
devbranch="master",
devbranch="main",
devurl="dev",
push_preview=true,
versions=["stable" => "v^", "v#.#"],
Expand Down
12 changes: 6 additions & 6 deletions docs/src/reference/internal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Internal API

```@autodocs
Modules = [SiennaTemplate]
Public = false
```
# Internal API

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

```@autodocs
Modules = [SiennaTemplate]
Public = true
```
# Public API Reference

```@autodocs
Modules = [SiennaTemplate]
Public = true
```
6 changes: 3 additions & 3 deletions docs/src/tutorials/intro_page.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SIIP-Examples
# SIENNA-Examples

All the tutorials for the SIIP project are part of a separate repository
[SIIP-Examples](https://github.com/NREL-SIIP/SIIPExamples.jl).
All the tutorials for the SIENNA project are part of a separate repository
[SIENNA-Examples](https://github.com/NREL-SIENNA/SIENNAExamples.jl).
214 changes: 107 additions & 107 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,107 +1,107 @@
using Test
import Logging

import Aqua
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(
"Debug" => Logging.Debug,
"Info" => Logging.Info,
"Warn" => Logging.Warn,
"Error" => Logging.Error,
)

"""
Copied @includetests from https://github.com/ssfrr/TestSetExtensions.jl.
Ideally, we could import and use TestSetExtensions. Its functionality was broken by changes
in Julia v0.7. Refer to https://github.com/ssfrr/TestSetExtensions.jl/pull/7.
"""

"""
Includes the given test files, given as a list without their ".jl" extensions.
If none are given it will scan the directory of the calling file and include all
the julia files.
"""
macro includetests(testarg...)
if length(testarg) == 0
tests = []
elseif length(testarg) == 1
tests = testarg[1]
else
error("@includetests takes zero or one argument")
end

quote
tests = $tests
rootfile = @__FILE__
if length(tests) == 0
tests = readdir(dirname(rootfile))
tests = filter(
f ->
startswith(f, "test_") && endswith(f, ".jl") && f != basename(rootfile),
tests,
)
else
tests = map(f -> string(f, ".jl"), tests)
end
println()
for test in tests
print(splitext(test)[1], ": ")
include(test)
println()
end
end
end

function get_logging_level_from_env(env_name::String, default)
level = get(ENV, env_name, default)
return IS.get_logging_level(level)
end

function run_tests()
logging_config_filename = get(ENV, "SIIP_LOGGING_CONFIG", nothing)
if logging_config_filename !== nothing
config = IS.LoggingConfiguration(logging_config_filename)
else
config = IS.LoggingConfiguration(;
filename = LOG_FILE,
file_level = Logging.Info,
console_level = Logging.Error,
)
end
console_logger = ConsoleLogger(config.console_stream, config.console_level)

IS.open_file_logger(config.filename, config.file_level) do file_logger
levels = (Logging.Info, Logging.Warn, Logging.Error)
multi_logger =
IS.MultiLogger([console_logger, file_logger], IS.LogEventTracker(levels))
global_logger(multi_logger)

if !isempty(config.group_levels)
IS.set_group_levels!(multi_logger, config.group_levels)
end

# Testing Topological components of the schema
@time @testset "Begin SIIP-PACKAGE tests" begin
@includetests ARGS
end

@test length(IS.get_log_events(multi_logger.tracker, Logging.Error)) == 0
@info IS.report_log_summary(multi_logger)
end
end

logger = global_logger()

try
run_tests()
finally
# Guarantee that the global logger is reset.
global_logger(logger)
nothing
end
using Test
import Logging

import Aqua
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(
"Debug" => Logging.Debug,
"Info" => Logging.Info,
"Warn" => Logging.Warn,
"Error" => Logging.Error,
)

"""
Copied @includetests from https://github.com/ssfrr/TestSetExtensions.jl.
Ideally, we could import and use TestSetExtensions. Its functionality was broken by changes
in Julia v0.7. Refer to https://github.com/ssfrr/TestSetExtensions.jl/pull/7.
"""

"""
Includes the given test files, given as a list without their ".jl" extensions.
If none are given it will scan the directory of the calling file and include all
the julia files.
"""
macro includetests(testarg...)
if length(testarg) == 0
tests = []
elseif length(testarg) == 1
tests = testarg[1]
else
error("@includetests takes zero or one argument")
end

quote
tests = $tests
rootfile = @__FILE__
if length(tests) == 0
tests = readdir(dirname(rootfile))
tests = filter(
f ->
startswith(f, "test_") && endswith(f, ".jl") && f != basename(rootfile),
tests,
)
else
tests = map(f -> string(f, ".jl"), tests)
end
println()
for test in tests
print(splitext(test)[1], ": ")
include(test)
println()
end
end
end

function get_logging_level_from_env(env_name::String, default)
level = get(ENV, env_name, default)
return IS.get_logging_level(level)
end

function run_tests()
logging_config_filename = get(ENV, "SIENNA_LOGGING_CONFIG", nothing)
if logging_config_filename !== nothing
config = IS.LoggingConfiguration(logging_config_filename)
else
config = IS.LoggingConfiguration(;
filename = LOG_FILE,
file_level = Logging.Info,
console_level = Logging.Error,
)
end
console_logger = ConsoleLogger(config.console_stream, config.console_level)

IS.open_file_logger(config.filename, config.file_level) do file_logger
levels = (Logging.Info, Logging.Warn, Logging.Error)
multi_logger =
IS.MultiLogger([console_logger, file_logger], IS.LogEventTracker(levels))
global_logger(multi_logger)

if !isempty(config.group_levels)
IS.set_group_levels!(multi_logger, config.group_levels)
end

# Testing Topological components of the schema
@time @testset "Begin SIENNA-PACKAGE tests" begin
@includetests ARGS
end

@test length(IS.get_log_events(multi_logger.tracker, Logging.Error)) == 0
@info IS.report_log_summary(multi_logger)
end
end

logger = global_logger()

try
run_tests()
finally
# Guarantee that the global logger is reset.
global_logger(logger)
nothing
end

0 comments on commit 3649d2d

Please sign in to comment.