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 into
slaclab: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 into
slaclab:mainfrom
Derikka:archiver

Conversation

@Derikka

@Derikka Derikka commented Sep 4, 2024

Copy link
Copy Markdown
Collaborator

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
Comment thread backend/archive_data.py Outdated
Comment thread backend/archive_data.py
Comment thread backend/backend_cavity.py
Comment thread backend/fault.py Outdated
Comment thread backend/fault.py Outdated
Comment thread display.py Outdated
Comment thread utils/utils.py Outdated
Comment thread backend/archive_data.py
@lisazacarias

Copy link
Copy Markdown
Collaborator

Oh and can you add tests for all new functions?

Comment thread backend/archive_data.py Outdated
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?

Comment thread backend/fault.py Outdated
Comment thread utils/utils.py
^ 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!!!

Comment thread backend/archive_data.py
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.

Comment thread 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

Comment thread 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

Comment thread backend/fault_count_display.py Outdated
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