Make a bar chart of fault and invalid counts for a cavity based on Archiver data#91
Make a bar chart of fault and invalid counts for a cavity based on Archiver data#91Derikka wants to merge 25 commits intoslaclab:mainfrom
Conversation
…d fault counts on the same bar graph)
|
Oh and can you add tests for all new functions? |
backend/archive_data.py
Outdated
| DISPLAY_MACHINE = Machine(cavity_class=BackendCavity) | ||
|
|
||
|
|
||
| class FaultCounter(Display): |
There was a problem hiding this comment.
I really love documentation I think it helps especially if you need to come back and change anything. Maybe you can add some docstrings to the class and methods to explain their purpose/functionality?
| ^ hash(tlc) | ||
| ^ hash(suffix) | ||
| ^ hash(prefix) | ||
| ) |
There was a problem hiding this comment.
Overall your code looks great good job!!!
| main_v_layout = QVBoxLayout() | ||
| input_h_layout = QHBoxLayout() | ||
|
|
||
| self.plot_window = pg.plot() |
There was a problem hiding this comment.
Maybe you can break this up into smaller methods(you don't have to, it just makes for better readability and easier tests) For example: you could have a method for the setup layouts and the creating plot windows etc.
backend/fault.py
Outdated
| self.pv: PV = PV(pv, connection_timeout=PV_TIMEOUT) | ||
|
|
||
| def is_currently_faulted(self): | ||
| # returns "FALSE" if not faulted. aka Are you faulted? FALSE! All good here |
There was a problem hiding this comment.
This is perhaps a little too informal lol
backend/fault.py
Outdated
| raise PVInvalidError(self.pv.pvname) | ||
|
|
||
| # "is not None" means it has a value. | ||
| # self.ok_value = value stated in spreadsheet |
There was a problem hiding this comment.
I would replace "=" with "is the" just because my brain read it as pseudocode at first and I got confused lol
backend/fault_count_display.py
Outdated
| start = self.start_selector.dateTime().toPyDateTime() | ||
| end = self.end_selector.dateTime().toPyDateTime() | ||
|
|
||
| # Ex. result is a dictionary with: |
There was a problem hiding this comment.
Why are all the lines starting with "Ex."? Also, you can create a multiline comment with triple quotes!
There was a problem hiding this comment.
I forgot that was an option, thank you!
…d Corrective Action column to TLC decoder
The backend files were also changed/updated in order to accommodate being able to access archiver data