Skip to content

Commit

Permalink
Feat: Raio test cases still have to make json files (#41)
Browse files Browse the repository at this point in the history
* Feat: Raio test cases still have to make json files

* feat: added pandas and numpy

* code backup

* cleanup

* pass: updated test cases

* feat: added build target for lowDeltaT

* fix: add newline

* feat: add --quiet flag to invoke.py

* feat: AnomalyError

* feat: add analysis tools for low_delta_t

* feat: allow Title case CW point names

---------

Co-authored-by: logo0303 <you@example.com>
  • Loading branch information
stevemandl and logo0303 authored Jun 27, 2024
1 parent 9caf0ab commit 353d406
Show file tree
Hide file tree
Showing 14 changed files with 70,951 additions and 79 deletions.
2 changes: 1 addition & 1 deletion py_src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL := /bin/bash
build-PythonTemplate:
build-PythonTemplate build-LowDeltaT:
cp -r ./* $(ARTIFACTS_DIR)
pip install --upgrade pip
pip install pipenv
Expand Down
4 changes: 4 additions & 0 deletions py_src/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ name = "pypi"
requests = "*"
python-dateutil = "*"
pyyaml = {version=">=6.0.1"}
numpy = "*"
pandas = "*"
matplotlib = "*"
tk = "*"

[dev-packages]
pytest = {version=">=6.2"}
Expand Down
599 changes: 533 additions & 66 deletions py_src/Pipfile.lock

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions py_src/invoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@
help="timeStamp (e.g. 'Jan 5, 2022' or 1676005200)",
)

args = parser.parse_args()
print(
f"\ninvoke.py arguments:\n function: {args.function}, pointName: {args.pointName}, timeStamp: {args.timeStamp} "
parser.add_argument(
"-q",
"--quiet",
action="store_true",
help="no output unless anomaly detected",
)

args = parser.parse_args()
if not args.quiet:
print(
f"\ninvoke.py arguments:\n function: {args.function}, pointName: {args.pointName}, timeStamp: {args.timeStamp} "
)
event = {"body": {"pointName": args.pointName}}
if args.timeStamp is not None:
event["body"]["timeStamp"] = args.timeStamp
Expand All @@ -46,15 +54,15 @@

pkg = importlib.import_module(f"{m.group('pkg')}.{m.group('subpkg')}")
fn = getattr(pkg, m.group("fn"))
print(f"Calling function ...")
if not args.quiet: print(f"Calling function ...")
start = time.time()
result = fn(event, None)
end = time.time()
print(f"Received response: '{result}'")
if not args.quiet: print(f"Received response: '{result}'")
if result["statusCode"] == 200:
print("Algorithm executed without an error")
if not args.quiet: print("Algorithm executed without an error")
if result["body"]:
print(f"ANOMALY DETECTED: {result['body']}")
else:
print("No anomaly was detected")
print(f"Function elapsed run time (seconds): '{end-start:.3}'.\n")
if not args.quiet: print("No anomaly was detected")
if not args.quiet: print(f"Function elapsed run time (seconds): '{end-start:.3}'.\n")
120 changes: 120 additions & 0 deletions py_src/invokeAllCW.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash
exec {points}<<eof
AliceCookHouse.CW.FP/TONS
AppelCommons.10064.FleximF721/CW.Tons
BaileyHall.CW.FP/TONS
BakerLab.CW.FP/TONS
BarbaraMcClintockHall.B0061.FleximF721/CW.Tons
BardHall.CW.FP/TONS
BarnesHall.CW.FP/TONS
BartonHall.CW.FP/TONS
BeebeHall.LowerMER.FleximF721/CW.Tons
BigRedBarn.10001.FleximF721/CW.Tons
BiotechnologyBuilding.CW.FP/TONS
BoyceThompsonInstitute.CW.FP/TONS
BradfieldHall.CW.FP/TONS
BrucknerLab.CW.FP/TONS
CaldwellHall.CW.FP/TONS
CampusStore.CW.ES749/TONS
CampusStore.CW.FP/TONS
CarlBeckerHouse.CW.FP/TONS
CarpenterHall.CW.FP/TONS
ClarkHall.CW.FP/TONS
ClinicalProgramsCenter.CW.FP/TONS
ComputingCommunicationsCenter.CW.FP/TONS
ComstockHall.CW.FP/TONS
CorsonMuddComplex.CW.FleximF721/TONS
CourtHall.CW.FP/TONS
DayHall.CW.FP/TONS
DuffieldHall.CW.FP/TONS
EastCampusResearchFacility.CW.FP/TONS
EmersonHall.CW.FP/TONS
FernowHall.CW.FP/TONS
FloraRoseHouse.CW.FP/TONS
Foundry.RandMER.FleximF721/CW.Tons
FriedmanWrestlingCenter.CW.FP/TONS
GannettHealthCenter.CW.FP/TONS
GatesHall.CW.FP/TONS
GoldwinSmithHall.CW.FP/TONS
GrummanHall.CW.FP/TONS
HansBetheHouse.CW.FP/TONS
HollisterHall.CW.FP/TONS
HughesHall.CW.FleximF721/TONS
HughesHall.CW.FP/TONS
HumanEcologyBuilding.CW.FP/TONS
HumphreysServiceBuilding.CW.FP/TONS
HuShihHall.B0061.FleximF721/CW.Tons
IthacaHighSchool.CW.FP/TONS
IvesHall.CW.FP/TONS
JohnsonMuseumOfArt.CW.FP/TONS
KimballHall.CW.FleximF721/TONS
KlarmanHall.CW.FP/TONS
KrochLibrary.CW.FP/TONS
LargeAnimalResearchTeachingUnit.CW.FP/TONS
LincolnHall.CW.FP/TONS
LynahRink.CW.FP/TONS
MalottHall.CW.FP/TONS
MannLibrary.CW.FP/TONS
MarthaVanRensselaerComplex.MAIN.CW.FP/TONS
MarthaVanRensselaerWest.CW.FleximF704/TONS
MilsteinHall.CW.FP/TONS
MorrillHall.CW.FP/TONS
MorrisonHall.CW.FP/TONS
MyronTaylorHall.CW.FP/TONS
NewmanLab.CW.FP/TONS
NoyesCommunityRecreationCenter.CW.FP/TONS
OlinChemistryResearchWing.CW.FP/TONS
OlinHall.CW.FP/TONS
OlinLibrary.CW.FP/TONS
PhillipsHall.CW.FP/TONS
PhysicalSciences.CW.FP/TONS
PlantScience.CW.FP/TONS
RandHall.CW.FP/TONS
RhodesHall.7thfloor.NOC.CW.FP/TONS
RhodesHall.CW.FP/TONS
RhodesHall.Telecom.CW.FP/TONS
RileyRobbHall.CW.FP/TONS
RobertPurcellCommunityCenter.CW.FP/TONS
RobertWHolleyCenter.CW.FP/TONS
RockefellerHall.CW.FP/TONS
RuthBaderGinsburgHall.B0069.FleximF721/CW.Tons
SageHall.CW.FP/TONS
SavageHall.CW.FP/TONS
SchoellkopfHall.CW.FP/TONS
SchurmanHall.CW.FP/TONS
SchurmanNorth.CW.FP/TONS
SchwartzCenterForPerformingArts.CW.FP/TONS
SibleyHall.CW.FP/TONS
SneeHall.CW.FP/TONS
SpaceSciencesBuilding.CW.FP/TONS
StatlerHall.CW.FP/TONS
StatlerHotel.CW.FP/TONS
StimsonHall.CW.FP/TONS
StockingHall.CW.FP/TONS
ToniMorrisonHall.Bsmt.FleximF721/CW.TONS
ToniMorrisonHall.Coolers.CW.FleximF721/TONS
UpsonHall.CW.FP/TONS
UrisHall.CW.FP/TONS
UrisLibrary.CW.FP/TONS
VetDiagnosticLab.CW.FP/TONS
VetMedicalCenter.CW.FP/TONS
VetResearchTower.CW.FP/TONS
WardLab.CW.FP/TONS
WarrenHall.CW.FP/TONS
WeillHall.AHU-2.CW.FP/TONS
WeillHall.AHU-3.CW.FP/TONS
WeillHall.AHU-5.CW.FP/TONS
WeillHall.CW.FP/TONS
WeillHall.PlantGrowth.CW.FP/TONS
WhiteHall.CW.FP/TONS
WillardStraightHall.CW.FP/TONS
WilliamKeetonHouse.CW.FP/TONS
WilsonLab.400U.FleximF721/CW.CoolingLoops.Tons
WilsonLab.400U.FleximF721/CW.ExperimentalHall.Tons
WilsonLab.CW.FleximF721/TONS
WilsonLab.CW.FP/TONS
WingHall.CW.FP/TONS
eof
while read -ru $points point; do
python invoke.py low_delta_t/handler.run $point -q
done
Loading

0 comments on commit 353d406

Please sign in to comment.