diff --git a/README.md b/README.md index af00476..8c1af60 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +# Setting up environment +```bash +brew install uv +uv pip compile requirements.in -o requirements.txt +python3 -m venv .venv +source .venv/bin/activate # or for fish: source .venv/bin/activate.fish +pip install -r requirements.txt +``` + # Synthetic Healthcare Data ## README from Observable Framework default documentation @@ -61,7 +70,7 @@ A typical Framework project looks like this: Clone the repo, then run: Set up environment: ```bash -python3 -m venv .venv +python3 -m venv .venv ``` Activate the environment: @@ -83,7 +92,7 @@ pip install pip-tools Compile dependencies: ```bash -pip-compile +pip-compile ``` Initializing a dbt project: @@ -162,4 +171,4 @@ Check the total payment amount: # Contact -File an issue here or email `hello@onefact.org`. +File an issue here or email `hello@onefact.org`. diff --git a/notebooks/risk_adjustment_example.ipynb b/notebooks/risk_adjustment_example.ipynb new file mode 100644 index 0000000..3403e12 --- /dev/null +++ b/notebooks/risk_adjustment_example.ipynb @@ -0,0 +1,33 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "1c7cdde7-1268-4e6f-a657-27ca245d9580", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.14" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/requirements.in b/requirements.in index 07967d9..3235c07 100644 --- a/requirements.in +++ b/requirements.in @@ -1,17 +1,36 @@ +altair +anywidget +beartype +boto3 bs4 dbt-duckdb -pandas -numpy -matplotlib -seaborn -tqdm -pyarrow -sqlfluff +duckdb-engine +geopandas +great_tables ipykernel +ipywidgets +jupyter +jupyter-ai +jupyterlab jupysql -pip-tools -duckdb-engine -pdfplumber +langchain-anthropic +lightning +matplotlib +mosaic-widget +numpy openpyxl +pandas +pdfplumber pip-tools -boto3 +playwright +psutil +pyarrow +python-dotenv +pyzmq +ruff +seaborn +seedir +sqlfluff +tabulate +tqdm +vega_datasets diff --git a/requirements.txt b/requirements.txt index 979ac01..4dd942f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,32 +1,77 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile -# -agate==1.7.1 - # via dbt-core -annotated-types==0.6.0 +# This file was autogenerated by uv via the following command: +# uv pip compile requirements.in -o requirements.txt +agate==1.9.1 + # via + # dbt-adapters + # dbt-common + # dbt-core +aiohappyeyeballs==2.3.2 + # via aiohttp +aiohttp==3.10.0 + # via + # fsspec + # langchain + # langchain-community +aiosignal==1.3.1 + # via aiohttp +aiosqlite==0.20.0 + # via jupyter-ai +altair==5.3.0 + # via -r requirements.in +annotated-types==0.7.0 # via pydantic +anthropic==0.32.0 + # via langchain-anthropic +anyio==4.4.0 + # via + # anthropic + # httpx + # jupyter-server +anywidget==0.9.13 + # via + # -r requirements.in + # mosaic-widget appdirs==1.4.4 # via sqlfluff appnope==0.1.4 # via ipykernel +argon2-cffi==23.1.0 + # via jupyter-server +argon2-cffi-bindings==21.2.0 + # via argon2-cffi +arrow==1.3.0 + # via isoduration asttokens==2.4.1 # via stack-data +async-lru==2.0.4 + # via jupyterlab +async-timeout==4.0.3 + # via + # aiohttp + # langchain attrs==23.2.0 # via + # aiohttp # jsonschema # referencing -babel==2.14.0 - # via agate +babel==2.15.0 + # via + # agate + # great-tables + # jupyterlab-server backoff==2.2.1 # via posthog +beartype==0.18.5 + # via -r requirements.in beautifulsoup4==4.12.3 - # via bs4 -boto3==1.34.122 + # via + # bs4 + # nbconvert +bleach==6.1.0 + # via nbconvert +boto3==1.34.151 # via -r requirements.in -botocore==1.34.122 +botocore==1.34.151 # via # boto3 # s3transfer @@ -34,12 +79,17 @@ bs4==0.0.2 # via -r requirements.in build==1.2.1 # via pip-tools -certifi==2024.2.2 - # via requests +certifi==2024.7.4 + # via + # httpcore + # httpx + # pyogrio + # pyproj + # requests cffi==1.16.0 # via + # argon2-cffi-bindings # cryptography - # dbt-core chardet==5.2.0 # via # diff-cover @@ -50,343 +100,829 @@ charset-normalizer==3.3.2 # requests click==8.1.7 # via + # dask # dbt-core # dbt-semantic-interfaces + # distributed + # jupyter-ai-magics # pip-tools # sqlfluff +cloudpickle==3.0.0 + # via + # dask + # distributed colorama==0.4.6 # via - # dbt-core + # dbt-common # sqlfluff comm==0.2.2 - # via ipykernel + # via + # ipykernel + # ipywidgets +commonmark==0.9.1 + # via great-tables contourpy==1.2.1 # via matplotlib -cryptography==42.0.5 +cryptography==43.0.0 # via pdfminer-six cycler==0.12.1 # via matplotlib -dbt-core==1.7.11 +daff==1.3.46 + # via dbt-core +dask==2024.7.1 + # via + # distributed + # jupyter-ai +dataclasses-json==0.6.7 + # via langchain-community +dbt-adapters==1.4.0 + # via + # dbt-core + # dbt-duckdb +dbt-common==1.7.0 + # via + # dbt-adapters + # dbt-core + # dbt-duckdb +dbt-core==1.8.4 # via dbt-duckdb -dbt-duckdb==1.7.3 +dbt-duckdb==1.8.2 # via -r requirements.in dbt-extractor==0.5.1 # via dbt-core -dbt-semantic-interfaces==0.4.4 +dbt-semantic-interfaces==0.5.1 # via dbt-core -debugpy==1.8.1 +debugpy==1.8.2 # via ipykernel decorator==5.1.1 # via ipython -diff-cover==8.0.3 +deepdiff==7.0.1 + # via dbt-common +deepmerge==1.1.1 + # via jupyter-ai +defusedxml==0.7.1 + # via + # langchain-anthropic + # nbconvert +diff-cover==9.1.1 # via sqlfluff -duckdb==0.10.1 +distributed==2024.7.1 + # via dask +distro==1.9.0 + # via anthropic +duckdb==1.0.0 # via # dbt-duckdb # duckdb-engine -duckdb-engine==0.11.2 + # mosaic-widget +duckdb-engine==0.13.1 # via -r requirements.in et-xmlfile==1.1.0 # via openpyxl -exceptiongroup==1.2.1 +exceptiongroup==1.2.2 # via + # anyio # ipython # pytest executing==2.0.1 # via stack-data -fonttools==4.51.0 +faiss-cpu==1.8.0 + # via jupyter-ai +fastjsonschema==2.20.0 + # via nbformat +filelock==3.15.4 + # via + # huggingface-hub + # torch +fonttools==4.53.1 # via matplotlib +fqdn==1.5.1 + # via jsonschema +frozenlist==1.4.1 + # via + # aiohttp + # aiosignal +fsspec==2024.6.1 + # via + # dask + # huggingface-hub + # lightning + # pytorch-lightning + # torch +geopandas==1.0.1 + # via -r requirements.in +great-tables==0.10.0 + # via -r requirements.in greenlet==3.0.3 - # via sqlalchemy -idna==3.6 # via - # dbt-core + # playwright + # sqlalchemy +h11==0.14.0 + # via httpcore +htmltools==0.5.3 + # via great-tables +httpcore==1.0.5 + # via httpx +httpx==0.27.0 + # via + # anthropic + # jupyterlab +huggingface-hub==0.24.5 + # via tokenizers +idna==3.7 + # via + # anyio + # httpx + # jsonschema # requests + # yarl importlib-metadata==6.11.0 - # via dbt-semantic-interfaces + # via + # dask + # dbt-semantic-interfaces + # great-tables + # jupyter-ai + # jupyter-ai-magics +importlib-resources==6.4.0 + # via great-tables iniconfig==2.0.0 # via pytest -ipykernel==6.29.4 - # via -r requirements.in -ipython==8.23.0 - # via ipykernel +ipykernel==6.29.5 + # via + # -r requirements.in + # jupyter + # jupyter-console + # jupyterlab + # qtconsole +ipython==8.26.0 + # via + # ipykernel + # ipywidgets + # jupyter-ai-magics + # jupyter-console ipython-genutils==0.2.0 # via jupysql +ipywidgets==8.1.3 + # via + # -r requirements.in + # anywidget + # jupyter isodate==0.6.1 # via # agate - # dbt-core + # dbt-common +isoduration==20.11.0 + # via jsonschema jedi==0.19.1 # via ipython -jinja2==3.1.3 +jinja2==3.1.4 # via + # altair + # dbt-common # dbt-core # dbt-semantic-interfaces # diff-cover + # distributed # jupysql + # jupyter-server + # jupyterlab + # jupyterlab-server + # nbconvert # sqlfluff + # torch +jiter==0.5.0 + # via anthropic jmespath==1.0.1 # via # boto3 # botocore -jsonschema==4.21.1 +json5==0.9.25 + # via jupyterlab-server +jsonpatch==1.33 + # via langchain-core +jsonpath-ng==1.6.1 + # via jupyter-ai-magics +jsonpointer==3.0.0 + # via + # jsonpatch + # jsonschema +jsonschema==4.23.0 # via - # dbt-core + # altair + # dbt-common # dbt-semantic-interfaces + # jupyter-events + # jupyterlab-server + # nbformat jsonschema-specifications==2023.12.1 # via jsonschema -jupysql==0.10.10 +jupysql==0.10.12 # via -r requirements.in -jupysql-plugin==0.4.3 +jupysql-plugin==0.4.4 # via jupysql -jupyter-client==8.6.1 - # via ipykernel +jupyter==1.0.0 + # via -r requirements.in +jupyter-ai==2.20.0 + # via -r requirements.in +jupyter-ai-magics==2.20.0 + # via jupyter-ai +jupyter-client==8.6.2 + # via + # ipykernel + # jupyter-console + # jupyter-server + # nbclient + # qtconsole +jupyter-console==6.6.3 + # via jupyter jupyter-core==5.7.2 # via # ipykernel # jupyter-client + # jupyter-console + # jupyter-server + # jupyterlab + # nbclient + # nbconvert + # nbformat + # qtconsole +jupyter-events==0.10.0 + # via jupyter-server +jupyter-lsp==2.2.5 + # via jupyterlab +jupyter-server==2.14.2 + # via + # jupyter-ai + # jupyter-lsp + # jupyterlab + # jupyterlab-server + # notebook + # notebook-shim +jupyter-server-terminals==0.5.3 + # via jupyter-server +jupyterlab==4.2.4 + # via + # -r requirements.in + # jupyter-ai + # notebook +jupyterlab-pygments==0.3.0 + # via nbconvert +jupyterlab-server==2.27.3 + # via + # jupyterlab + # notebook +jupyterlab-widgets==3.0.11 + # via ipywidgets kiwisolver==1.4.5 # via matplotlib +langchain==0.2.11 + # via + # jupyter-ai-magics + # langchain-community +langchain-anthropic==0.1.21 + # via -r requirements.in +langchain-community==0.2.10 + # via jupyter-ai-magics +langchain-core==0.2.25 + # via + # langchain + # langchain-anthropic + # langchain-community + # langchain-text-splitters +langchain-text-splitters==0.2.2 + # via langchain +langsmith==0.1.94 + # via + # langchain + # langchain-community + # langchain-core leather==0.4.0 # via agate +lightning==2.3.3 + # via -r requirements.in +lightning-utilities==0.11.6 + # via + # lightning + # pytorch-lightning + # torchmetrics +locket==1.0.0 + # via + # distributed + # partd logbook==1.5.3 # via dbt-core markupsafe==2.1.5 - # via jinja2 -mashumaro[msgpack]==3.12 - # via dbt-core -matplotlib==3.8.4 + # via + # jinja2 + # nbconvert +marshmallow==3.21.3 + # via dataclasses-json +mashumaro==3.13.1 + # via + # dbt-adapters + # dbt-common + # dbt-core +matplotlib==3.9.1 # via # -r requirements.in # seaborn -matplotlib-inline==0.1.6 +matplotlib-inline==0.1.7 # via # ipykernel # ipython minimal-snowplow-tracker==0.0.2 # via dbt-core +mistune==3.0.2 + # via nbconvert monotonic==1.6 # via posthog -more-itertools==10.2.0 +more-itertools==10.3.0 # via dbt-semantic-interfaces +mosaic-widget==0.10.0 + # via -r requirements.in +mpmath==1.3.0 + # via sympy msgpack==1.0.8 - # via mashumaro + # via + # distributed + # mashumaro +multidict==6.0.5 + # via + # aiohttp + # yarl +mypy-extensions==1.0.0 + # via typing-inspect +natsort==8.4.0 + # via seedir +nbclient==0.10.0 + # via nbconvert +nbconvert==7.16.4 + # via + # jupyter + # jupyter-server +nbformat==5.10.4 + # via + # jupyter-server + # nbclient + # nbconvert nest-asyncio==1.6.0 # via ipykernel networkx==3.3 - # via dbt-core + # via + # dbt-core + # torch +notebook==7.2.1 + # via jupyter +notebook-shim==0.2.4 + # via + # jupyterlab + # notebook numpy==1.26.4 # via # -r requirements.in + # altair # contourpy + # faiss-cpu + # geopandas + # great-tables + # langchain + # langchain-community + # lightning # matplotlib # pandas # pyarrow + # pyogrio + # pytorch-lightning # seaborn -openpyxl==3.1.2 + # shapely + # torchmetrics +openpyxl==3.1.5 # via -r requirements.in -packaging==24.0 - # via +ordered-set==4.1.0 + # via deepdiff +orjson==3.10.6 + # via langsmith +overrides==7.7.0 + # via jupyter-server +packaging==24.1 + # via + # altair # build + # dask # dbt-core + # distributed + # duckdb-engine + # geopandas + # htmltools + # huggingface-hub # ipykernel + # jupyter-server + # jupyterlab + # jupyterlab-server + # langchain-core + # lightning + # lightning-utilities + # marshmallow # matplotlib + # nbconvert + # pyogrio # pytest -pandas==2.2.1 + # pytorch-lightning + # qtconsole + # qtpy + # torchmetrics +pandas==2.2.2 # via # -r requirements.in + # altair + # geopandas # seaborn + # vega-datasets +pandocfilters==1.5.1 + # via nbconvert parsedatetime==2.6 # via agate parso==0.8.4 # via jedi -pathspec==0.11.2 +partd==1.4.2 + # via dask +pathspec==0.12.1 # via + # dbt-common # dbt-core # sqlfluff pdfminer-six==20231228 # via pdfplumber -pdfplumber==0.11.0 +pdfplumber==0.11.2 # via -r requirements.in pexpect==4.9.0 # via ipython -pillow==10.3.0 +pillow==10.4.0 # via # matplotlib # pdfplumber +pip==24.2 + # via pip-tools pip-tools==7.4.1 # via -r requirements.in -platformdirs==4.2.0 +platformdirs==4.2.2 # via jupyter-core +playwright==1.45.1 + # via -r requirements.in ploomber-core==0.2.25 # via # jupysql # jupysql-plugin # ploomber-extension -ploomber-extension==0.1.0 +ploomber-extension==0.1.1 # via jupysql -pluggy==1.4.0 +pluggy==1.5.0 # via # diff-cover # pytest +ply==3.11 + # via jsonpath-ng posthog==3.5.0 # via ploomber-core -prettytable==3.10.0 +prettytable==3.10.2 # via jupysql -prompt-toolkit==3.0.43 - # via ipython -protobuf==4.25.3 - # via dbt-core -psutil==5.9.8 - # via ipykernel +prometheus-client==0.20.0 + # via jupyter-server +prompt-toolkit==3.0.47 + # via + # ipython + # jupyter-console +protobuf==4.25.4 + # via + # dbt-adapters + # dbt-common + # dbt-core +psutil==6.0.0 + # via + # -r requirements.in + # distributed + # ipykernel +psygnal==0.11.1 + # via anywidget ptyprocess==0.7.0 - # via pexpect -pure-eval==0.2.2 + # via + # pexpect + # terminado +pure-eval==0.2.3 # via stack-data -pyarrow==15.0.2 - # via -r requirements.in +pyarrow==17.0.0 + # via + # -r requirements.in + # mosaic-widget pycparser==2.22 # via cffi -pydantic==2.6.4 - # via dbt-semantic-interfaces -pydantic-core==2.16.3 +pydantic==2.8.2 + # via + # anthropic + # dbt-semantic-interfaces + # langchain + # langchain-core + # langsmith +pydantic-core==2.20.1 # via pydantic -pygments==2.17.2 +pyee==11.1.0 + # via playwright +pygments==2.18.0 # via # diff-cover # ipython + # jupyter-console + # nbconvert + # qtconsole +pyogrio==0.9.0 + # via geopandas pyparsing==3.1.2 # via matplotlib -pypdfium2==4.28.0 +pypdfium2==4.30.0 # via pdfplumber -pyproject-hooks==1.0.0 +pyproj==3.6.1 + # via geopandas +pyproject-hooks==1.1.0 # via # build # pip-tools -pytest==8.1.1 +pytest==8.3.2 # via sqlfluff python-dateutil==2.9.0.post0 # via + # arrow # botocore + # dbt-common # dbt-semantic-interfaces # jupyter-client # matplotlib # pandas # posthog +python-dotenv==1.0.1 + # via -r requirements.in +python-json-logger==2.0.7 + # via jupyter-events python-slugify==8.0.4 # via agate pytimeparse==1.1.8 # via agate +pytorch-lightning==2.3.3 + # via lightning pytz==2024.1 # via + # dbt-adapters # dbt-core # pandas pyyaml==6.0.1 # via + # dask # dbt-core # dbt-semantic-interfaces + # distributed + # huggingface-hub + # jupyter-events + # langchain + # langchain-community + # langchain-core + # lightning # ploomber-core + # pytorch-lightning # sqlfluff -pyzmq==25.1.2 +pyzmq==26.0.3 # via + # -r requirements.in # ipykernel # jupyter-client -referencing==0.34.0 + # jupyter-console + # jupyter-server + # qtconsole +qtconsole==5.5.2 + # via jupyter +qtpy==2.4.1 + # via qtconsole +referencing==0.35.1 # via # jsonschema # jsonschema-specifications -regex==2023.12.25 + # jupyter-events +regex==2024.7.24 # via sqlfluff -requests==2.31.0 +requests==2.32.3 # via + # dbt-common # dbt-core + # huggingface-hub + # jupyterlab-server + # langchain + # langchain-community + # langsmith # minimal-snowplow-tracker # posthog -rpds-py==0.18.0 +rfc3339-validator==0.1.4 + # via + # jsonschema + # jupyter-events +rfc3986-validator==0.1.1 + # via + # jsonschema + # jupyter-events +rpds-py==0.19.1 # via # jsonschema # referencing -s3transfer==0.10.1 +ruff==0.5.5 + # via -r requirements.in +s3transfer==0.10.2 # via boto3 seaborn==0.13.2 # via -r requirements.in +seedir==0.5.0 + # via -r requirements.in +send2trash==1.8.3 + # via jupyter-server +setuptools==72.1.0 + # via + # jupyterlab + # lightning-utilities + # pip-tools +shapely==2.0.5 + # via geopandas six==1.16.0 # via # asttokens + # bleach # isodate # minimal-snowplow-tracker # posthog # python-dateutil + # rfc3339-validator +sniffio==1.3.1 + # via + # anthropic + # anyio + # httpx +sortedcontainers==2.4.0 + # via distributed soupsieve==2.5 # via beautifulsoup4 -sqlalchemy==2.0.29 +sqlalchemy==2.0.31 # via # duckdb-engine # jupysql -sqlfluff==3.0.3 + # langchain + # langchain-community +sqlfluff==3.1.0 # via -r requirements.in -sqlglot==23.7.0 +sqlglot==25.8.1 # via jupysql -sqlparse==0.4.4 +sqlparse==0.5.1 # via # dbt-core # jupysql stack-data==0.6.3 # via ipython +sympy==1.13.1 + # via torch +tabulate==0.9.0 + # via -r requirements.in tblib==3.0.0 - # via sqlfluff + # via + # distributed + # sqlfluff +tenacity==8.5.0 + # via + # langchain + # langchain-community + # langchain-core +terminado==0.18.1 + # via + # jupyter-server + # jupyter-server-terminals text-unidecode==1.3 # via python-slugify +tinycss2==1.3.0 + # via nbconvert +tokenizers==0.19.1 + # via anthropic toml==0.10.2 # via sqlfluff tomli==2.0.1 # via # build + # jupyterlab # pip-tools - # pyproject-hooks # pytest -tornado==6.4 +toolz==0.12.1 + # via + # altair + # dask + # distributed + # partd +torch==2.2.2 + # via + # lightning + # pytorch-lightning + # torchmetrics +torchmetrics==1.4.0.post0 + # via + # lightning + # pytorch-lightning +tornado==6.4.1 # via + # distributed # ipykernel # jupyter-client -tqdm==4.66.2 + # jupyter-server + # jupyterlab + # notebook + # terminado +tqdm==4.66.4 # via # -r requirements.in + # huggingface-hub + # lightning + # pytorch-lightning # sqlfluff -traitlets==5.14.2 +traitlets==5.14.3 # via # comm # ipykernel # ipython + # ipywidgets + # jupyter-ai # jupyter-client + # jupyter-console # jupyter-core + # jupyter-events + # jupyter-server + # jupyterlab # matplotlib-inline -typing-extensions==4.11.0 - # via + # nbclient + # nbconvert + # nbformat + # qtconsole +types-python-dateutil==2.9.0.20240316 + # via arrow +typing-extensions==4.12.2 + # via + # aiosqlite + # altair + # anthropic + # anyio + # anywidget + # async-lru + # dbt-adapters + # dbt-common # dbt-core # dbt-semantic-interfaces + # great-tables + # htmltools + # huggingface-hub # ipython + # jupyter-ai + # jupyter-ai-magics + # lightning + # lightning-utilities # mashumaro # pydantic # pydantic-core + # pyee + # pytorch-lightning # sqlalchemy - # sqlfluff + # torch + # typing-inspect +typing-inspect==0.9.0 + # via dataclasses-json tzdata==2024.1 # via pandas -urllib3==1.26.18 +uri-template==1.3.0 + # via jsonschema +urllib3==2.2.2 # via # botocore - # dbt-core + # distributed # requests +vega-datasets==0.9.0 + # via -r requirements.in wcwidth==0.2.13 # via # prettytable # prompt-toolkit +webcolors==24.6.0 + # via jsonschema +webencodings==0.5.1 + # via + # bleach + # tinycss2 +websocket-client==1.8.0 + # via jupyter-server wheel==0.43.0 # via pip-tools -zipp==3.18.1 +widgetsnbextension==4.0.11 + # via ipywidgets +yarl==1.9.4 + # via aiohttp +zict==3.0.0 + # via distributed +zipp==3.19.2 # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools