Skip to content

Commit

Permalink
Merge pull request #3 from revisit-studies/test
Browse files Browse the repository at this point in the history
Turned into well-formed package with Widget
  • Loading branch information
bbollen23 authored Jan 11, 2025
2 parents ba69dba + 4a26d26 commit cf2f956
Show file tree
Hide file tree
Showing 39 changed files with 6,491 additions and 5,736 deletions.
12 changes: 9 additions & 3 deletions .gitignore
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
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

54 changes: 51 additions & 3 deletions README.md
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 removed __init__.py
Empty file.
Loading

0 comments on commit cf2f956

Please sign in to comment.