time_wise 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8a3307886b5b581361c56c78b1f1605be9cfb9199c2c500bc0122737f812e5b5
4
+ data.tar.gz: 159cb833e152cb36cac61b1657dbdfe263b0e4159a5310234f381fb05ce03720
5
+ SHA512:
6
+ metadata.gz: b1f99257cc228406c08f5cefe47c900702efdd4aea32062a38603507d0be30cbfc541a589ba559d12587a006284f676c869862f3f5daa0579192c9d2e8731343
7
+ data.tar.gz: 0da26d623fc56ca743822ec34c95a322015727aea03fa72081957753b954f8e735440d2d911aabaeca68ac5f63490cfcf8d56f74dbb7a4386f7fd6baa03be921
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,46 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.1
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: double_quotes
6
+
7
+ Style/StringLiteralsInInterpolation:
8
+ EnforcedStyle: double_quotes
9
+
10
+ Metrics/MethodLength:
11
+ Max: 12 # Default is 10; you can increase if needed
12
+ Enabled: false # Disables the check completely
13
+
14
+ Metrics/ClassLength:
15
+ Max: 175 # Default is 100; increase as required
16
+ Enabled: false # Disables the check completely
17
+
18
+ Metrics/AbcSize:
19
+ Enabled: false
20
+
21
+ Metrics/ParameterLists:
22
+ Max: 8 # Default is 5; increase if needed
23
+ Enabled: false
24
+
25
+ Metrics/CyclomaticComplexity:
26
+ Enabled: false
27
+
28
+ Metrics/PerceivedComplexity:
29
+ Enabled: false
30
+
31
+ Metrics/BlockLength:
32
+ Enabled: false
33
+
34
+ Naming/MethodParameterName:
35
+ MinNameLength: 1 # Allows short names like 'q'
36
+ Enabled: false
37
+
38
+ Naming/VariableNumber:
39
+ Enabled: false
40
+
41
+ Layout/LineLength:
42
+ Max: 184 # Adjust based on your longest line
43
+ Enabled: false
44
+
45
+ Gemspec/RequiredRubyVersion:
46
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-03-22
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in time_wise.gemspec
6
+ gemspec
7
+
8
+ gem "irb"
9
+ gem "rake", "~> 13.0"
10
+
11
+ gem "rspec", "~> 3.0"
12
+
13
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,86 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ time_wise (0.1.0)
5
+ ascii_charts (~> 0.9.1)
6
+ numo-narray (~> 0.9.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ascii_charts (0.9.1)
12
+ ast (2.4.3)
13
+ date (3.4.1)
14
+ diff-lcs (1.6.0)
15
+ io-console (0.8.0)
16
+ irb (1.15.1)
17
+ pp (>= 0.6.0)
18
+ rdoc (>= 4.0.0)
19
+ reline (>= 0.4.2)
20
+ json (2.10.2)
21
+ language_server-protocol (3.17.0.4)
22
+ lint_roller (1.1.0)
23
+ numo-narray (0.9.2.1)
24
+ parallel (1.26.3)
25
+ parser (3.3.7.2)
26
+ ast (~> 2.4.1)
27
+ racc
28
+ pp (0.6.2)
29
+ prettyprint
30
+ prettyprint (0.2.0)
31
+ psych (5.2.3)
32
+ date
33
+ stringio
34
+ racc (1.8.1)
35
+ rainbow (3.1.1)
36
+ rake (13.2.1)
37
+ rdoc (6.12.0)
38
+ psych (>= 4.0.0)
39
+ regexp_parser (2.10.0)
40
+ reline (0.6.0)
41
+ io-console (~> 0.5)
42
+ rspec (3.13.0)
43
+ rspec-core (~> 3.13.0)
44
+ rspec-expectations (~> 3.13.0)
45
+ rspec-mocks (~> 3.13.0)
46
+ rspec-core (3.13.3)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-expectations (3.13.3)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-mocks (3.13.2)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.13.0)
54
+ rspec-support (3.13.2)
55
+ rubocop (1.74.0)
56
+ json (~> 2.3)
57
+ language_server-protocol (~> 3.17.0.2)
58
+ lint_roller (~> 1.1.0)
59
+ parallel (~> 1.10)
60
+ parser (>= 3.3.0.2)
61
+ rainbow (>= 2.2.2, < 4.0)
62
+ regexp_parser (>= 2.9.3, < 3.0)
63
+ rubocop-ast (>= 1.38.0, < 2.0)
64
+ ruby-progressbar (~> 1.7)
65
+ unicode-display_width (>= 2.4.0, < 4.0)
66
+ rubocop-ast (1.41.0)
67
+ parser (>= 3.3.7.2)
68
+ ruby-progressbar (1.13.0)
69
+ stringio (3.1.5)
70
+ unicode-display_width (3.1.4)
71
+ unicode-emoji (~> 4.0, >= 4.0.4)
72
+ unicode-emoji (4.0.4)
73
+
74
+ PLATFORMS
75
+ ruby
76
+ x86_64-linux
77
+
78
+ DEPENDENCIES
79
+ irb
80
+ rake (~> 13.0)
81
+ rspec (~> 3.0)
82
+ rubocop (~> 1.21)
83
+ time_wise!
84
+
85
+ BUNDLED WITH
86
+ 2.6.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 TODO: Write your name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # TimeWise
2
+
3
+ TimeWise is a Ruby gem for time series analysis and visualization. It offers intuitive tools for working with time-dependent data, perfect for e-commerce, healthcare, sports analytics, and more.
4
+
5
+ ## Features
6
+
7
+ - **Core Statistical Functions**: Calculate mean, median, standard deviation, variance, skewness, kurtosis, etc.
8
+ - **Moving Averages**: Simple, weighted, exponential, and advanced smoothing techniques
9
+ - **Data Visualization**: Basic visualization capabilities for analyzing trends
10
+ - **Time Series Operations**: Slicing, manipulating, and analyzing time-indexed data
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'time_wise'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ ```bash
23
+ $ bundle install
24
+ ```
25
+
26
+ Or install it yourself as:
27
+
28
+ ```bash
29
+ $ gem install time_wise
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ### Creating a Time Series
35
+
36
+ ```ruby
37
+ require 'time_wise'
38
+
39
+ # Create a time series from an array of values
40
+ data = [100, 110, 120, 115, 125, 130, 140]
41
+ ts = TimeWise.create(data)
42
+
43
+ # With dates
44
+ dates = [
45
+ Date.new(2023, 1, 1),
46
+ Date.new(2023, 1, 2),
47
+ Date.new(2023, 1, 3),
48
+ Date.new(2023, 1, 4),
49
+ Date.new(2023, 1, 5),
50
+ Date.new(2023, 1, 6),
51
+ Date.new(2023, 1, 7)
52
+ ]
53
+ ts_with_dates = TimeWise.create(data, dates)
54
+
55
+ # Load from CSV
56
+ ts_from_csv = TimeWise.load_csv('data.csv', 'value', 'date')
57
+ ```
58
+
59
+ ### Basic Statistics
60
+
61
+ ```ruby
62
+ # Calculate basic statistics
63
+ mean = ts.stats.mean
64
+ median = ts.stats.median
65
+ std_dev = ts.stats.std_dev
66
+
67
+ # Get a summary of all statistics
68
+ summary = ts.stats.summary
69
+ puts summary[:mean]
70
+ puts summary[:std_dev]
71
+
72
+ # Calculate autocorrelation
73
+ acf = ts.stats.autocorrelation(5) # For lags 0-5
74
+
75
+ # Calculate correlation between two time series
76
+ correlation = ts1.stats.correlation(ts2)
77
+ ```
78
+
79
+ ### Moving Averages
80
+
81
+ ```ruby
82
+ # Simple moving average with window size 3
83
+ sma = ts.moving_average.simple(3)
84
+
85
+ # Exponential moving average with alpha=0.2
86
+ ema = ts.moving_average.exponential(0.2)
87
+
88
+ # Weighted moving average with custom weights
89
+ weights = [0.1, 0.2, 0.3, 0.4]
90
+ wma = ts.moving_average.weighted(4, weights)
91
+
92
+ # Double exponential smoothing (Holt's method)
93
+ dema = ts.moving_average.double_exponential(0.2, 0.1)
94
+ ```
95
+
96
+ ### Visualization
97
+
98
+ ```ruby
99
+ # Generate a line chart
100
+ ts.plot.line_chart(title: "My Time Series")
101
+
102
+ # Compare two time series
103
+ ts.plot.comparison_chart(another_ts, title: "Comparison")
104
+
105
+ # Export to CSV
106
+ ts.plot.export_csv("output.csv")
107
+
108
+ # Display data as a table
109
+ puts ts.plot.data_table(10) # Show first 10 rows
110
+ ```
111
+
112
+ ## Coming Soon (in Future Releases)
113
+
114
+ - **ARIMA Models**: For advanced time series forecasting
115
+ - **Seasonal Analysis**: Tools for detecting and working with seasonal patterns
116
+ - **Advanced Visualization**: More chart types and interactive plotting
117
+ - **Anomaly Detection**: Methods for identifying outliers and unusual patterns
118
+
119
+ ## Development
120
+
121
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
122
+
123
+ ## Contributing
124
+
125
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yourusername/time_wise.
126
+
127
+ ## License
128
+
129
+ The gem is available as open source under the terms of the MIT License.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,170 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "numo/narray"
4
+ require "date"
5
+
6
+ module TimeWise
7
+ # The Base class is the foundation of all time series operations in TimeWise
8
+ class Base
9
+ attr_reader :data, :dates
10
+
11
+ # Initialize a new time series object
12
+ # @param data [Array] Array of numeric values representing the time series
13
+ # @param dates [Array] Optional array of dates corresponding to each data point
14
+ def initialize(data, dates = nil)
15
+ validate_inputs(data, dates)
16
+
17
+ @data = Numo::DFloat.cast(data)
18
+ @dates = dates
19
+
20
+ if dates&.length&.positive?
21
+ @has_dates = true
22
+ @frequency = detect_frequency
23
+ else
24
+ @has_dates = false
25
+ @frequency = nil
26
+ end
27
+ end
28
+
29
+ # Get the time series as a hash with date and value arrays
30
+ # @return [Hash] Hash with :dates and :values keys
31
+ def to_h
32
+ if @has_dates
33
+ { dates: @dates, values: @data.to_a }
34
+ else
35
+ { indices: (0...@data.size).to_a, values: @data.to_a }
36
+ end
37
+ end
38
+
39
+ # Get a section of the time series
40
+ # @param start_idx [Integer] Starting index
41
+ # @param end_idx [Integer] Ending index
42
+ # @return [TimeWise::Base] A new time series with the specified data range
43
+ def slice(start_idx, end_idx)
44
+ end_idx = @data.size - 1 if end_idx >= @data.size
45
+
46
+ new_data = @data[start_idx..end_idx]
47
+ new_dates = @has_dates ? @dates[start_idx..end_idx] : nil
48
+
49
+ TimeWise.create(new_data.to_a, new_dates)
50
+ end
51
+
52
+ # Get a section of the time series by date range
53
+ # @param start_date [Date, DateTime, String] Starting date
54
+ # @param end_date [Date, DateTime, String] Ending date
55
+ # @return [TimeWise::Base] A new time series with the specified date range
56
+ def slice_by_date(start_date, end_date)
57
+ raise TimeWise::Errors::MissingDatesError, "Time series has no date information" unless @has_dates
58
+
59
+ parsed_start = parse_date(start_date)
60
+ parsed_end = parse_date(end_date)
61
+
62
+ indices = find_indices_in_date_range(parsed_start, parsed_end)
63
+
64
+ new_data = indices.map { |idx| @data[idx] }
65
+ new_dates = indices.map { |idx| @dates[idx] }
66
+
67
+ TimeWise.create(new_data, new_dates)
68
+ end
69
+
70
+ # Convert to array
71
+ # @return [Array] The time series data as a standard Ruby array
72
+ def to_a
73
+ @data.to_a
74
+ end
75
+
76
+ # Length of the time series
77
+ # @return [Integer] Number of data points
78
+ def length
79
+ @data.size
80
+ end
81
+
82
+ # Apply basic statistical methods
83
+ def stats
84
+ TimeWise::Statistics.new(self)
85
+ end
86
+
87
+ # Access moving average methods
88
+ def moving_average
89
+ TimeWise::MovingAverage.new(self)
90
+ end
91
+
92
+ # Access visualization methods
93
+ def plot
94
+ TimeWise::Visualization.new(self)
95
+ end
96
+
97
+ private
98
+
99
+ def validate_inputs(data, dates)
100
+ validate_data(data)
101
+ validate_dates(data, dates) if dates
102
+ end
103
+
104
+ def validate_data(data)
105
+ raise ArgumentError, "Data cannot be empty" if data.nil? || data.empty?
106
+
107
+ return if data.all? { |v| v.is_a?(Numeric) || v.to_f.to_s != "NaN" }
108
+
109
+ raise ArgumentError, "All data points must be numeric"
110
+ end
111
+
112
+ def validate_dates(data, dates)
113
+ return unless dates.length != data.length
114
+
115
+ raise ArgumentError, "Dates array must match data array length"
116
+ end
117
+
118
+ def parse_date(date)
119
+ date.is_a?(String) ? DateTime.parse(date) : date
120
+ end
121
+
122
+ def find_indices_in_date_range(start_date, end_date)
123
+ @dates.each_with_index
124
+ .select { |date, _idx| date >= start_date && date <= end_date }
125
+ .map { |_, idx| idx }
126
+ end
127
+
128
+ def detect_frequency
129
+ return nil if @dates.length < 2
130
+
131
+ most_common_diff = find_most_common_diff
132
+
133
+ seconds_to_frequency(most_common_diff * 86_400) # Convert to seconds (from days)
134
+ end
135
+
136
+ def find_most_common_diff
137
+ # Calculate differences between consecutive timestamps
138
+ diffs = (1...@dates.length).map { |i| (@dates[i] - @dates[i - 1]).to_f }
139
+
140
+ # Find the most common difference (mode)
141
+ freq_counts = diffs.group_by(&:itself).transform_values(&:count)
142
+ freq_counts.max_by { |_, count| count }.first
143
+ end
144
+
145
+ def seconds_to_frequency(seconds)
146
+ case seconds.round
147
+ when 60
148
+ :minute
149
+ when 3600
150
+ :hour
151
+ when 86_400
152
+ :day
153
+ when 604_800
154
+ :week
155
+ else
156
+ longer_frequencies(seconds)
157
+ end
158
+ end
159
+
160
+ def longer_frequencies(seconds)
161
+ if seconds.round.between?(2.5 * 10**6, 2.7 * 10**6)
162
+ :month
163
+ elsif seconds.round.between?(3 * 10**7, 3.16 * 10**7)
164
+ :year
165
+ else
166
+ :custom
167
+ end
168
+ end
169
+ end
170
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TimeWise
4
+ module Errors
5
+ # Base error class for TimeWise
6
+ class Error < StandardError; end
7
+
8
+ # Raised when attempting to access dates on a time series without date information
9
+ class MissingDatesError < Error
10
+ def initialize(msg = "This operation requires date information, but the time series has no dates")
11
+ super
12
+ end
13
+ end
14
+
15
+ class InvalidDataError < Error; end
16
+
17
+ # Raised when the window size for operations is invalid
18
+ class InvalidWindowError < Error; end
19
+ end
20
+ end