Skip to content

Feat coupled trial generator#23

Open
micahwoodard wants to merge 24 commits intomainfrom
feat-coupled-trial-generator
Open

Feat coupled trial generator#23
micahwoodard wants to merge 24 commits intomainfrom
feat-coupled-trial-generator

Conversation

@micahwoodard
Copy link
Collaborator

No description provided.

@bruno-f-cruz
Copy link
Member

@micahwoodard I made a release with the implementation of the distributions here https://github.com/AllenNeuralDynamics/Aind.Behavior.Services/releases/tag/v0.13.1

Copy link
Member

@bruno-f-cruz bruno-f-cruz left a comment

Choose a reason for hiding this comment

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

First pass but I think we need to iterate a bit.
A lot of fields are missing descriptions. Remember descriptions in these pydantic models are important since we can use them later to automatically provide docs in Bonsai, UIs, schemas, data, etc...


class RewardProbabilityParameters(BaseModel):
base_reward_sum: float = Field(default=0.8, title="Sum of p_reward")
family: int = Field(default=1, title="Reward family")
Copy link
Member

Choose a reason for hiding this comment

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

what is a reward family and why is it "1"?

class RewardProbabilityParameters(BaseModel):
base_reward_sum: float = Field(default=0.8, title="Sum of p_reward")
family: int = Field(default=1, title="Reward family")
pairs_n: int = Field(default=1, title="Number of pairs")
Copy link
Member

Choose a reason for hiding this comment

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

Can we leverage the description field in Field(...) to add a little bit more information about what these parameters are? We can leverage this in multiple places later so it is important to be clear with these schemas!



class Block(BaseModel):
right_reward_prob: float
Copy link
Member

Choose a reason for hiding this comment

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

Add:

  • Validation (e.g: min and max)
  • Try to always use the same way to refer to the same concept. Sometimes probability is "p", sometimes "prob"
  • Add description to these fields too

inter_trial_interval_duration=iti,
)

def are_end_conditions_met(self) -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

This seems empty? is this supposed to be an abstract method? Is this an abstract class?
Consider making this method private using _.

Check if end conditions are met to stop session
"""

def generate_next_block(
Copy link
Member

Choose a reason for hiding this comment

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

Consider making this a private method since it should never be called from outside the class if i understand correctly

) -> Block:
"""
Generate the next block for a block based task.

Copy link
Member

Choose a reason for hiding this comment

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

The pyproject specifies google doc style. This looks like sphinx. Can you refactor to make sure everything is homogeneous?


dependencies = [
"aind_behavior_services<0.14",
"aind_behavior_services@ git+https://github.com/AllenNeuralDynamics/Aind.Behavior.Services.git@v0.13.2rc1",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"aind_behavior_services@ git+https://github.com/AllenNeuralDynamics/Aind.Behavior.Services.git@v0.13.2rc1",
"aind_behavior_services>=0.13.2",

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.

2 participants