diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17472d0e2..79eb2df2f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,11 +10,11 @@ Bug reports are welcome, especially those reported with [short, self-contained, ### Quick start -You'll need Python>=3.12 to build the backend and Node>=20 to build the frontend. Then, you can install dependencies and run the dashboard with: +You'll need Python>=3.12 to build the backend and Node>=20 to build the frontend. Then, you can install dependencies and run the UI with: ```sh make install make build-frontend -make serve-dashboard +make serve-ui ``` You are now all setup to run the library locally. @@ -55,7 +55,7 @@ in the `frontend` directory Then, to use the frontend ```sh make build-frontend -make serve-dashboard +make serve-ui ``` ### Documentation @@ -69,3 +69,9 @@ Then, you can access the local build via: ```sh open doc/_build/html/index.html ``` + +## Help for common issues + +### `make build-frontend` doesn't work! + +Please check that your version of node is at least 20 using the following command: `node -v` diff --git a/Makefile b/Makefile index 1001a9c7b..99c1cc363 100644 --- a/Makefile +++ b/Makefile @@ -17,15 +17,15 @@ check-wip: serve-api: SKORE_ROOT=$(SKORE_ROOT) python -m uvicorn \ - --factory skore.api:create_api_app \ + --factory skore.ui.app:create_app \ --reload --reload-dir ./src \ --host 0.0.0.0 \ --port 22140 \ --timeout-graceful-shutdown 0 -serve-dashboard: +serve-ui: SKORE_ROOT=$(SKORE_ROOT) python -m uvicorn \ - --factory skore.dashboard:create_dashboard_app \ + --factory skore.ui.app:create_app \ --reload --reload-dir ./src \ --host 0.0.0.0 \ --port 22140 \ @@ -36,11 +36,11 @@ build-frontend: cd frontend && npm install cd frontend && npm run build # empty app static folder - rm -rf src/skore/dashboard/static - cp -a frontend/dist/. src/skore/dashboard/static + rm -rf src/skore/ui/static + cp -a frontend/dist/. src/skore/ui/static # build the sharing library cd frontend && npm run build:lib - cp -a frontend/dist/. src/skore/dashboard/static + cp -a frontend/dist/. src/skore/ui/static # clean up rm -rf frontend/dist diff --git a/README.md b/README.md index 9a82e0c1d..7a9f9b6f9 100644 --- a/README.md +++ b/README.md @@ -5,53 +5,64 @@ ## Installation For now, the only supported method to use skore is from source. -Follow the instructions in [CONTRIBUTING.md](/CONTRIBUTING.md#quick-start) to install dependencies and start the dashboard. +Follow the instructions in [CONTRIBUTING.md](/CONTRIBUTING.md#quick-start) to install dependencies and start the UI. ## Quick start -For a complete introductory example, see our [basic usage notebook](/notebooks/basic_usage.ipynb). The resulting skore dashboard has been exported to [this HTML file](https://gist.github.com/augustebaum/6b21dbd7f7d5a584fbf2c1956692574e): download it and open it in your browser to visualize it. +For a complete introductory example, see our [basic usage notebook](/notebooks/basic_usage.ipynb). The resulting skore report has been exported to [this HTML file](https://gist.github.com/augustebaum/6b21dbd7f7d5a584fbf2c1956692574e): download it and open it in your browser to visualize it. -Initialize and use a Store as follows: +In your shell, run the following to create a project file `project.skore` (the default) in your current working directory: +```sh +python -m skore create +``` + +Run the following in your Python code to load the project: ```python -from skore import Store +from skore import load -store = Store("root/probabl") +project = load("project.skore") ``` -To initialize a Store, we need to give it a root path. -A store also needs some physical storage to get and put items from/into. By default, this storage will be in a `.datamander` directory in the current working directory. This can be customized by setting the MANDR_ROOT environment variable. +You can save items you need to track in your project: +```python +project.put("my int", 3) +``` +You can also get them back: ```python -store.insert("my int", 3) -store.read("my int") +project.get("my int") +``` +By default, strings are assumed to be Markdown: +```python +project.put("my string", "Hello world!") +``` -# Strings are assumed to be Markdown: -store.insert("my string", "Hello world!") -store.update("my string", "Hello again!") +Note that `put` overwrites previous data +```python +project.put("my string", "Hello again!") +``` -for key, value in store.items(): - print(f"Key {key} corresponds to value {value}") +You can list all the keys in a project with: +```python +project.list_keys() +``` -store.delete("my int") +You can delete items with: +```python +project.delete_item("my int") ``` -Then, in your project root (i.e. where `.datamander` is), run the following command to start the frontend locally: +Then, in the directory containing your project, run the following command to start the UI locally: ```sh -python -m skore launch .datamander +python -m skore launch project.skore ``` -This should automatically open a browser tab pointing at the app URL. - -## Help for common issues +This will automatically open a browser at the UI's location. -### `make build-frontend` doesn't work! - -Please check that your version of node is at least 20 using the following command: `node -v` ## Roadmap - With Skore, you can: - Store data - Visualize data @@ -61,11 +72,6 @@ In the future, you will be able to: - Extract insights from your data - Get tips on how to improve your data science code -## Concepts - -- A **Store** is the core concept of this project. It is a dict-like data structure that implements a CRUD interface. -- A **Storage** represents the actual data storage medium, e.g. a computer's filesystem or an S3 bucket. Every Store has one Storage. - ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for more information and to contribute to the evolution of this library. +See [CONTRIBUTING.md](/CONTRIBUTING.md) for more information and to contribute to the evolution of this library. diff --git a/frontend/README.md b/frontend/README.md index e33b568e4..3cdba40d5 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,4 +1,4 @@ -# Dashboard +# Skore UI This sub directory aims at creating a single page application supporting Skore. diff --git a/frontend/src/ShareApp.vue b/frontend/src/ShareApp.vue index ce72387c8..86d9ef78c 100644 --- a/frontend/src/ShareApp.vue +++ b/frontend/src/ShareApp.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/components/DataStoreCanvas.vue b/frontend/src/components/DataStoreCanvas.vue deleted file mode 100644 index 95e17b976..000000000 --- a/frontend/src/components/DataStoreCanvas.vue +++ /dev/null @@ -1,138 +0,0 @@ - - - - - diff --git a/frontend/src/components/FileTree.vue b/frontend/src/components/FileTree.vue deleted file mode 100644 index 561e12c3e..000000000 --- a/frontend/src/components/FileTree.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - diff --git a/frontend/src/components/FileTreeItem.vue b/frontend/src/components/FileTreeItem.vue deleted file mode 100644 index 03e3624c9..000000000 --- a/frontend/src/components/FileTreeItem.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/frontend/src/components/HtmlSnippetWidget.vue b/frontend/src/components/HtmlSnippetWidget.vue index 3c023cd07..b341acc04 100644 --- a/frontend/src/components/HtmlSnippetWidget.vue +++ b/frontend/src/components/HtmlSnippetWidget.vue @@ -1,11 +1,21 @@