-
Notifications
You must be signed in to change notification settings - Fork 30
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
Frontend state & data flow rework #37
base: main
Are you sure you want to change the base?
Conversation
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.
looked very quickly and just had one issue to flag on the local model.
adatest/_topic_model.py
Outdated
@@ -157,8 +157,9 @@ def __init__(self, topic, test_tree): | |||
else: | |||
|
|||
# we are in a highly overparametrized situation, so we use a linear SVC to get "max-margin" based generalization | |||
self.model = CVModel() | |||
self.model.fit(embeddings, labels) | |||
self.model = ConstantModel(1.0) |
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.
Why is this switched? it seems like it will disable all topic learning :)
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.
Glad you found this, I was getting errors there for some reason so I made that change to temporarily unblock my work. I shouldn't have checked it in though. I'll revert it and double check everything still works.
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.
@slundberg Reverted and tested again with no issues. Thanks!
Reworks the way that Adatest's front end handles data caching and refreshes stale data.
Description of work
Implementation details
One slightly strange thing I had to do was figure out how to make our class-based components work with React's hooks, which can only work with function components. This was necessary because hooks have become the new standard for React libraries like Redux, and the new Redux Toolkit removes a lot of boilerplate previously required for Redux.
The general idea is to wrap a class component with a function component which is able to use hooks and pass on anything needed as props to the class component. In our case, the function components fetch data from the Redux store and pass it on as props for the class components, which allowed me to reuse almost all the logic inside the original class components.
The main files for Redux are
store.ts
andTestTreeSlice.ts
.Known issues
Things are mostly working, but there are still some bugs to fix. Work still in progress: