-
Notifications
You must be signed in to change notification settings - Fork 2
Anomaly tools changes #133
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
Draft
kiihne-noaa
wants to merge
20
commits into
main
Choose a base branch
from
anomaly_tools_changes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f052068
creating save_refmodel
kiihne-noaa eb5cba7
Update epmt_query.py
kiihne-noaa eab48d5
Update epmt_query.py
kiihne-noaa ef473e9
Update epmt_query.py
kiihne-noaa ff70178
Update epmt_query.py
kiihne-noaa d4c5eaf
Update epmt_query.py
kiihne-noaa 39de787
Update epmt_query.py
kiihne-noaa 3135e6d
Create test_save_refmodel.py
kiihne-noaa b9fb9d1
fixed orm import
kiihne-noaa aca0802
Update test_save_refmodel.py
kiihne-noaa 2855601
Update epmt_query.py
kiihne-noaa d211bf0
Update epmt_query.py
kiihne-noaa 74d6a20
changing tag variable to account for new settup
kiihne-noaa 6e8276f
Update epmt_query.py
kiihne-noaa 011ea21
adding fmt to save_refmodel default
kiihne-noaa 7695e43
Update epmt_query.py
kiihne-noaa 9578eb4
tag to {} if =None
kiihne-noaa e968ace
Update src/epmt/epmt_query.py
kiihne-noaa 1281d9f
Update src/epmt/epmt_query.py
kiihne-noaa b2b38dc
Merge branch 'main' into anomaly_tools_changes
ilaflott 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import numpy as np | ||
| import epmt | ||
| from epmt import epmt_query | ||
| # epmt_outliers contains the EPMT Outlier Detection API | ||
| from epmt import epmt_outliers as eod | ||
| # epmt_stat contains statistical functions | ||
| from epmt import epmt_stat as es | ||
| from epmt import epmt_query as eq | ||
| from epmt.orm import * | ||
| import pandas | ||
| from pandas import DataFrame | ||
|
|
||
| feature_list = [ 'duration', 'rchar', 'syscr', 'syscw', 'wchar', 'cstime', 'cutime', 'majflt', 'cpu_time', 'minflt', 'rssmax', 'cmajflt','cminflt', 'inblock', 'outblock', 'usertime', 'num_procs', 'starttime', 'vol_ctxsw', 'read_bytes', 'systemtime', 'time_oncpu', 'timeslices', 'invol_ctxsw', 'write_bytes', 'time_waiting', 'cancelled_write_bytes'] | ||
| random_jobs = eq.get_jobs(limit = 100, fmt = 'dict', trigger_post_process=False) | ||
|
|
||
| try: | ||
| r = eq.get_refmodels("bronx_test_model") | ||
| eq.delete_refmodels(r[0]['id']) | ||
| finally: | ||
| print("ready for new bronx model") | ||
| r = eq.create_refmodel(random_jobs, methods=es.mvod_classifiers(), features = feature_list, name = "bronx_test_model") | ||
|
|
||
| eq.save_refmodel(ReferenceModel, r['jobs'], r['computed'], r['info_dict'], r['enabled'], name='test_name', tag={}, op_tags=[]) | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is named like a unit test but behaves like a destructive integration script: it performs DB reads/writes, deletes existing models, and has no assertions. This will be flaky and potentially harmful in CI/dev environments.\n\nSuggested direction (pick one):\n- Convert it to a real automated test (e.g., pytest) with assertions and isolated DB/fixtures (and avoid deleting arbitrary existing models), or\n- Move it to a
scripts/orexamples/location and keep it out of the test discovery path.\n\nAlso, the call usestag={}butsave_refmodel()expectstags=...(per its signature).