Skip to content

Commit

Permalink
Merge pull request #349 from NREL-Sienna/dt/time-series-sqlite
Browse files Browse the repository at this point in the history
Re-design time series management
  • Loading branch information
daniel-thom authored Apr 26, 2024
2 parents 85fd65c + 5c89df2 commit e87f7b8
Show file tree
Hide file tree
Showing 45 changed files with 2,928 additions and 2,204 deletions.
24 changes: 14 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
TimeSeries = "9e3dc215-6440-5c97-bce1-76c03772f85e"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand All @@ -31,23 +33,25 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
CSV = "0.9, 0.10"
DataFrames = "~1.6"
DataStructures = "~0.18"
Dates = "1"
DocStringExtensions = "0.8, 0.9"
H5Zblosc = "0.1"
HDF5 = "0.17"
InteractiveUtils = "1"
JSON3 = "^1.11"
Logging = "1"
Mustache = "1"
Pkg = "1"
PrettyTables = "^1.3, 2"
Random = "1"
SHA = "0.7"
SQLite = "^1.6"
Serialization = "1"
StructTypes = "^1.9"
TOML = "1"
Tables = "^1.11"
TerminalLoggers = "~0.1"
TimeSeries = "0.23, 0.24"
UUIDs = "1"
YAML = "~0.4"
julia = "^1.6"
Dates = "1"
InteractiveUtils = "1"
Logging = "1"
Pkg = "1"
Random = "1"
Serialization = "1"
SHA = "0.7"
TOML = "1"
UUIDs = "1"
25 changes: 16 additions & 9 deletions src/InfrastructureSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ module InfrastructureSystems

import CSV
import DataFrames
import DataFrames: DataFrame
import Dates
import JSON3
import Logging
import Random
import Pkg
import PrettyTables
import SHA
import StructTypes
import TerminalLoggers: TerminalLogger, ProgressLevel
import TimeSeries
import TOML
using DataStructures: OrderedDict, SortedDict
import SQLite
import Tables

using DocStringExtensions

Expand Down Expand Up @@ -108,24 +112,19 @@ include("utils/generate_structs.jl")
include("utils/lazy_dict_from_iterator.jl")
include("utils/logging.jl")
include("utils/stdout_redirector.jl")
include("utils/sqlite.jl")
include("function_data.jl")
include("utils/utils.jl")
include("internal.jl")
include("time_series_storage.jl")
include("abstract_time_series.jl")
include("forecasts.jl")
include("static_time_series.jl")
include("time_series_container.jl")
include("time_series_parser.jl")
include("containers.jl")
include("component_uuids.jl")
include("supplemental_attribute.jl")
include("supplemental_attributes_container.jl")
include("supplemental_attributes.jl")
include("components.jl")
include("iterators.jl")
include("geographic_supplemental_attribute.jl")
include("generated/includes.jl")
include("time_series_parser.jl")
include("single_time_series.jl")
include("deterministic_single_time_series.jl")
include("deterministic.jl")
Expand All @@ -134,16 +133,24 @@ include("scenarios.jl")
include("deterministic_metadata.jl")
include("hdf5_time_series_storage.jl")
include("in_memory_time_series_storage.jl")
include("time_series_structs.jl")
include("time_series_formats.jl")
include("time_series_metadata_store.jl")
include("time_series_manager.jl")
include("time_series_interface.jl")
include("time_series_container.jl")
include("time_series_cache.jl")
include("time_series_parameters.jl")
include("time_series_utils.jl")
include("supplemental_attribute.jl")
include("supplemental_attributes_container.jl")
include("supplemental_attributes.jl")
include("components.jl")
include("iterators.jl")
include("component.jl")
include("results.jl")
include("serialization.jl")
include("system_data.jl")
include("subsystems.jl")
include("time_series_interface.jl")
include("validation.jl")
include("utils/print.jl")
include("utils/test.jl")
Expand Down
14 changes: 13 additions & 1 deletion src/abstract_time_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ Abstract type for time series stored in the system.
Components store references to these through TimeSeriesMetadata values so that data can
reside on storage media instead of memory.
"""
abstract type TimeSeriesData <: InfrastructureSystemsComponent end
abstract type TimeSeriesData <: InfrastructureSystemsType end

# Subtypes must implement
# - Base.length
# - get_resolution
# - make_time_array
# - eltype_data

abstract type AbstractTimeSeriesParameters <: InfrastructureSystemsType end

struct StaticTimeSeriesParameters <: AbstractTimeSeriesParameters end

@kwdef struct ForecastParameters <: AbstractTimeSeriesParameters
horizon::Int
initial_timestamp::Dates.DateTime
interval::Dates.Period
count::Int
resolution::Dates.Period
end
Loading

0 comments on commit e87f7b8

Please sign in to comment.