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

Jd/add infos #316

Merged
merged 47 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
16f87d2
add info types
jd-lara Nov 21, 2023
bb09978
generalize containers
jd-lara Nov 21, 2023
390e9b1
add geographic info as example
jd-lara Nov 21, 2023
f91f19e
fixes to compat
jd-lara Nov 29, 2023
24d2cc2
integrate info to components
jd-lara Nov 29, 2023
592a804
WIP integrating infos closer in the system data
jd-lara Nov 29, 2023
fda144e
add some additional functionality for geo info
jd-lara Nov 29, 2023
e5812b4
add info interface
jd-lara Nov 29, 2023
b532839
improve info interface
jd-lara Nov 29, 2023
caa18ef
WIP add testing
jd-lara Nov 29, 2023
d48e685
fix push! call
jd-lara Nov 29, 2023
db109e8
fix a very old typo
jd-lara Nov 29, 2023
d14f4bf
update printing methods
jd-lara Nov 29, 2023
47d1c70
add more info capabilities
jd-lara Nov 29, 2023
626cf93
add component and info removal
jd-lara Nov 29, 2023
d400498
update the methods for geo infos
jd-lara Nov 29, 2023
41fc858
improve testing and docs
jd-lara Nov 29, 2023
97b5f63
fix typo
jd-lara Nov 30, 2023
ec52c29
fix details
jd-lara Nov 30, 2023
597160e
implement system interface
jd-lara Nov 30, 2023
91f4e95
use types directly
jd-lara Nov 30, 2023
b4a3d4b
rename info -> supplemental_attribute
jd-lara Dec 4, 2023
d8c1439
Update src/InfrastructureSystems.jl
jd-lara Dec 12, 2023
904066f
Update src/component.jl
jd-lara Dec 12, 2023
a1e881b
name replace
jd-lara Dec 12, 2023
db36a70
fix more comments
jd-lara Dec 12, 2023
89ddbe6
fix more comments
jd-lara Dec 12, 2023
0d561e6
implement additional methods
jd-lara Dec 12, 2023
f875522
address comments in getters
jd-lara Dec 12, 2023
89ea1b4
remane geographic information object
jd-lara Dec 12, 2023
c87ebed
new methods and renames
jd-lara Dec 12, 2023
6be70b8
rename to GeographicInfo
jd-lara Dec 12, 2023
008204c
use try catch with removal
jd-lara Dec 12, 2023
f2855b1
formatter
jd-lara Dec 12, 2023
fc75db6
Update src/system_data.jl
jd-lara Dec 12, 2023
be0e6c5
fix almost all tests
jd-lara Dec 12, 2023
01c7911
address PR comments
jd-lara Dec 18, 2023
7a8de74
add time series testing
jd-lara Dec 18, 2023
4e2d04a
update formatter action
jd-lara Dec 18, 2023
cd73f60
address PR comments
jd-lara Dec 21, 2023
7c31557
address comments
jd-lara Dec 21, 2023
0f6b54d
address comments
jd-lara Dec 21, 2023
155ea39
use detach methods
jd-lara Dec 21, 2023
3a0d1b7
address PR comments
jd-lara Dec 21, 2023
423874f
more pr comments
jd-lara Dec 21, 2023
1192753
fix serialization
jd-lara Dec 21, 2023
deebdbc
formatter
jd-lara Dec 21, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install JuliaFormatter and format
run: |
julia -e 'include(".github/workflows/formatter/formatter_code.jl")'
julia -e 'include("scripts/formatter/formatter_code.jl")'
- uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/formatter/formatter_code.jl

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/formatter/formatter_docs.jl

This file was deleted.

10 changes: 8 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
Expand All @@ -38,6 +37,13 @@ Mustache = "1"
PrettyTables = "^1.3, 2"
StructTypes = "^1.9"
TerminalLoggers = "~0.1"
TimeSeries = "~0.22, 0.23"
TimeSeries = "0.23, 0.24"
YAML = "~0.4"
julia = "^1.6"
Dates = "1"
InteractiveUtils = "1"
Logging = "1"
Pkg = "1"
Random = "1"
TOML = "1"
UUIDs = "1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[compat]
JuliaFormatter = "v0.22.7"
julia = "^1.2"
JuliaFormatter = "1.0"
julia = "^1.7"
28 changes: 28 additions & 0 deletions scripts/formatter/formatter_code.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
Pkg.update()

using JuliaFormatter

main_paths = ["./src", "./test"]
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) && 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,

# always_use_return = true. # Disabled since it throws a lot of false positives
)
end
end
end
27 changes: 26 additions & 1 deletion src/InfrastructureSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
Optional interface functions:

- get_time_series_container()
- get_supplemental_attributes_container()

Subtypes may contain time series.
"""
Expand All @@ -53,6 +54,25 @@
"""
abstract type DeviceParameter <: InfrastructureSystemsType end

"""
Base type for structs that store supplemental attributes

Required interface functions for subtypes:

- get_internal()

Optional interface functions:

- get_time_series_container()
- get_component_uuids()
- get_uuid()

Subtypes may contain time series. Which requires

- get_time_series_container()
"""
abstract type InfrastructureSystemsSupplementalAttribute <: InfrastructureSystemsType end

"""
Return the internal time_series storage container or nothing, if the type doesn't store
time series.
Expand All @@ -63,7 +83,7 @@
return nothing
end

set_time_series_container!(value::InfrastructureSystemsComponent) = nothing
set_time_series_container!(value::InfrastructureSystemsComponent, _) = nothing

Check warning on line 86 in src/InfrastructureSystems.jl

View check run for this annotation

Codecov / codecov/patch

src/InfrastructureSystems.jl#L86

Added line #L86 was not covered by tests

get_name(value::InfrastructureSystemsComponent) = value.name

Expand Down Expand Up @@ -92,7 +112,11 @@
include("static_time_series.jl")
include("time_series_container.jl")
include("time_series_parser.jl")
include("containers.jl")
include("supplemental_attribute.jl")
include("supplemental_attributes.jl")
include("components.jl")
include("geographic_supplemental_attribute.jl")
include("generated/includes.jl")
include("single_time_series.jl")
include("deterministic_single_time_series.jl")
Expand All @@ -110,6 +134,7 @@
include("results.jl")
include("serialization.jl")
include("system_data.jl")
include("time_series_interface.jl")
include("validation.jl")
include("utils/print.jl")
include("utils/test.jl")
Expand Down
Loading
Loading