-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from revisit-studies/test
Turned into well-formed package with Widget
- Loading branch information
Showing
39 changed files
with
6,491 additions
and
5,736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
node_modules | ||
.venv | ||
*.pyc | ||
config.json | ||
__pycache__/ | ||
dist | ||
.DS_Store | ||
|
||
# Python | ||
__pycache__ | ||
.ipynb_checkpoints | ||
|
||
src/revisit/static |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,56 @@ | ||
# revisit-py | ||
# revisit | ||
|
||
## Installation | ||
|
||
## To generate models file: | ||
```sh | ||
pip install revisit | ||
``` | ||
|
||
or with [uv](https://github.com/astral-sh/uv): | ||
|
||
```sh | ||
uv add revisit | ||
``` | ||
|
||
## Development | ||
|
||
We recommend using [uv](https://github.com/astral-sh/uv) for development. | ||
It will automatically manage virtual environments and dependencies for you. | ||
|
||
```sh | ||
uv run jupyter lab example.ipynb | ||
``` | ||
|
||
Alternatively, create and manage your own virtual environment: | ||
|
||
```sh | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install -e ".[dev]" | ||
jupyter lab example.ipynb | ||
``` | ||
|
||
The widget front-end code bundles it's JavaScript dependencies. After setting up Python, | ||
make sure to install these dependencies locally: | ||
|
||
```sh | ||
yarn install | ||
``` | ||
|
||
While developing, you can run the following in a separate terminal to automatically | ||
rebuild JavaScript as you make changes: | ||
|
||
```sh | ||
yarn run dev | ||
``` | ||
|
||
Open `example.ipynb` in JupyterLab, VS Code, or your favorite editor | ||
to start developing. Changes made in `js/` will be reflected | ||
in the notebook. | ||
|
||
|
||
# CODE GEN | ||
|
||
```bash | ||
datamodel-codegen --input StudyConfigSchema.json --output models.py --custom-template-dir custom_templates --output-model-type pydantic_v2.BaseModel --additional-imports typing.TypedDict --input-file-type jsonschema --special-field-name-prefix we_are_going_to_replace_this && sed -i '' 's/we_are_going_to_replace_this_//g' models.py | ||
datamodel-codegen --input StudyConfigSchema.json --output models.py --custom-template-dir custom_templates --output-model-type pydantic_v2.BaseModel --additional-imports typing.TypedDict --input-file-type jsonschema --special-field-name-prefix we_are_going_to_replace_this && sed -i '' 's/we_are_going_to_replace_this_//g' src/revisit/models.py | ||
``` |
Empty file.
Oops, something went wrong.