-
Notifications
You must be signed in to change notification settings - Fork 4
feat: added plot_lagplot #548
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0f34ab4
added lag_plot
Gerhardsa0 418e62d
style: apply automated linter fixes
megalinter-bot b7d31d8
changed name and added numerical error if target contains non numeric…
Gerhardsa0 cd63409
Merge remote-tracking branch 'origin/519-feat-add-lag-plot-for-time-s…
Gerhardsa0 e1d52dd
changed name and added numerical error if target contains non numeric…
Gerhardsa0 7df7130
style: apply automated linter fixes
megalinter-bot d0ce066
fixed test
Gerhardsa0 73565b4
fixed test
Gerhardsa0 516941d
Merge remote-tracking branch 'origin/519-feat-add-lag-plot-for-time-s…
Gerhardsa0 d1f06fb
comment fixed
Gerhardsa0 02e6b33
style: apply automated linter fixes
megalinter-bot f820086
comment fixed
Gerhardsa0 be85f41
style: apply automated linter fixes
megalinter-bot ac2ef44
added review changes
Gerhardsa0 dda83cc
Merge remote-tracking branch 'origin/519-feat-add-lag-plot-for-time-s…
Gerhardsa0 e82f112
style: apply automated linter fixes
megalinter-bot cededcc
added review changes
Gerhardsa0 123accd
removed typehints
Gerhardsa0 081eea4
Merge remote-tracking branch 'origin/519-feat-add-lag-plot-for-time-s…
Gerhardsa0 e4138c7
removed typehints and reverted colum changes
Gerhardsa0 1d91367
style: apply automated linter fixes
megalinter-bot 4560e4e
reverted colum changes
Gerhardsa0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+11.3 KB
...ged_table/_time_series/__snapshots__/test_plot_lag/test_should_return_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
tests/safeds/data/tabular/containers/_table/_tagged_table/_time_series/test_plot_lag.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import pytest | ||
from safeds.data.tabular.containers import TimeSeries | ||
from safeds.exceptions import NonNumericColumnError | ||
from syrupy import SnapshotAssertion | ||
|
||
|
||
def test_should_return_table(snapshot_png: SnapshotAssertion) -> None: | ||
table = TimeSeries( | ||
{ | ||
"time": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | ||
"feature_1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | ||
"target": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | ||
}, | ||
target_name="target", | ||
time_name="time", | ||
feature_names=None, | ||
) | ||
lag_plot = table.plot_lagplot(lag=1) | ||
assert lag_plot == snapshot_png | ||
|
||
|
||
def test_should_raise_if_column_contains_non_numerical_values() -> None: | ||
table = TimeSeries( | ||
{ | ||
"time": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | ||
"feature_1": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | ||
"target": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], | ||
}, | ||
target_name="target", | ||
time_name="time", | ||
feature_names=None, | ||
) | ||
with pytest.raises( | ||
NonNumericColumnError, | ||
match=( | ||
r"Tried to do a numerical operation on one or multiple non-numerical columns: \nThis time series target" | ||
r" contains" | ||
r" non-numerical columns." | ||
), | ||
): | ||
table.plot_lagplot(2) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.