Skip to content

Make a bar chart of fault and invalid counts for a cavity based on Archiver data#91

Open
Derikka wants to merge 25 commits intoslaclab:mainfrom
Derikka:archiver
Open

Make a bar chart of fault and invalid counts for a cavity based on Archiver data#91
Derikka wants to merge 25 commits intoslaclab:mainfrom
Derikka:archiver

Conversation

@Derikka
Copy link
Copy Markdown
Collaborator

@Derikka Derikka commented Sep 4, 2024

The backend files were also changed/updated in order to accommodate being able to access archiver data

@Derikka Derikka requested review from a team and lisazacarias September 4, 2024 00:21
@lisazacarias
Copy link
Copy Markdown
Collaborator

Oh and can you add tests for all new functions?

DISPLAY_MACHINE = Machine(cavity_class=BackendCavity)


class FaultCounter(Display):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall your code looks great good job!!!

main_v_layout = QVBoxLayout()
input_h_layout = QHBoxLayout()

self.plot_window = pg.plot()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace "=" with "is the" just because my brain read it as pseudocode at first and I got confused lol

start = self.start_selector.dateTime().toPyDateTime()
end = self.end_selector.dateTime().toPyDateTime()

# Ex. result is a dictionary with:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are all the lines starting with "Ex."? Also, you can create a multiline comment with triple quotes!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that was an option, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants