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

Add complete docstrings and typehinting to aepsych python client #664

Closed
wants to merge 5 commits into from

Conversation

JasonKChow
Copy link
Contributor

Summary: Updated the aepsych python client to match the rest of the aepsych documentation/type hinting.

Differential Revision: D70426277

Summary:
Pull Request resolved: facebookresearch#663

The python client now runs unittests on Github and lints.

New mypy and format check now fails so these are fixed here too.

Differential Revision: D70407932
Summary:
Tells could handle a lot of different shapes before, we simplify this handling by unifying the shapes to our expected forms.

Cases are as follows:
* Parameter configuration dictionaries should have keys that are each parameter and the values should be one of a few forms:
* * If it's multi stimuli or multi trial (batch) or both, then it must be 2D. The first dimension represents the batch dimension and the second dimension represents the stimuli dimension.
* * * If the model is not multi stimuli and only multi trial, we remove the stimuli dimension on converting this to the tensor, otherwise we return batch, dim, stim.
* * * If the model is multi stimuli but only has 1 stiim, we assume this is for a prediction and handle it like multi stimuli still with batch, dim stim.
* * If it is a single value, it is assumed to be a single trial single stimuli case

Batch tells no longer allow a list of configuration dictionaries and instead follow the above case.
The pairwise probit now has an additional check to help handle this.

Differential Revision: D70285840
Summary: All message handlers return dictionaries now for a consistent api.

Differential Revision: D70255834
Summary: Update all docstring and typehints in message handlers to be in line with other parts of the codebase. We use type dicts where possible to directly specify what should be expected.

Differential Revision: D70365469
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 1, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70426277

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70426277

JasonKChow added a commit to JasonKChow/aepsych that referenced this pull request Mar 1, 2025
…ebookresearch#664)

Summary:
Pull Request resolved: facebookresearch#664

Updated the aepsych python client to match the rest of the aepsych documentation/type hinting.

Differential Revision: D70426277
…ebookresearch#664)

Summary:
Pull Request resolved: facebookresearch#664

Updated the aepsych python client to match the rest of the aepsych documentation/type hinting.

Differential Revision: D70426277
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70426277

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e894fde.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants