Skip to content
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

Refactor getAllExperimentConditions function for proper readability #2171

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

ppratikcr7
Copy link
Collaborator

This PR focus on adding helper functions for getAllExperimentConditions and reduce the complexity of the code. I have also added comments for better understanding.

@ppratikcr7 ppratikcr7 self-assigned this Jan 21, 2025
@ppratikcr7 ppratikcr7 changed the title Optimise getAllExperimentConditions function Refactor getAllExperimentConditions function for proper readability Jan 23, 2025
// Create new filtered experiment list
const alreadyAssignedExperiments = experimentPools.map((pool) => {
return pool.filter((experiment) => {
const individualEnrollment = mergedIndividualAssignment.find((enrollment) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not fixed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Already updated the alreadyAssignedExperiments to priorSelectedExperiments. Did you mean to update something else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we click the file from this conversation, it will take us to an outdated file, so changes wont be seen. We need to review it from the File Changes tab.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No the change I was asking for was to change find -> some
hasIndividualEnrollment and hasGroupEnrollment

@ppratikcr7 ppratikcr7 linked an issue Jan 30, 2025 that may be closed by this pull request
@VivekFitkariwala
Copy link
Collaborator

@ppratikcr7 can you add test cases for the new functions added in the PR?

…into optimize-getAllExperimentConditions
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.

Refactor getAllExperimentConditions function
2 participants