Skip to content

Commit

Permalink
Merge pull request #211 from 0Hughman0/0.3.x
Browse files Browse the repository at this point in the history
0.3.x
  • Loading branch information
0Hughman0 authored Nov 4, 2024
2 parents 06e8060 + 73b415b commit 109b0c0
Show file tree
Hide file tree
Showing 165 changed files with 7,273 additions and 2,387 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry install --all-extras
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -44,6 +44,7 @@ jobs:
- name: Typecheck with mypy
run: |
poetry run mypy cassini
poetry run mypy tests --exclude=tests/extensions/cassini_lib/mock_libraries/ --exclude=tests/project_cases
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry install --all-extras
- name: check tag and release version match
shell: bash
run: |
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
python -m pip install --upgrade pip
curl -sSL https://install.python-poetry.org | python3 -
poetry install
poetry install --all-extras
- name: Build package
run: poetry build
- name: Publish package
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ poetry.lock
.vscode/

# docs
docs/
/docs/
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
# Cassini

*Note Cassini is in it's alpha development stage, so things may not work perfectly - tell us about problems so we can fix them!*

An electronic laboratory notebook (ELN), built inside Jupyter Lab.

Cassini's goal is to help you explore, analyse and organise your data in an environment that's familiar.

![Screenshot](demo.gif)
https://github.com/user-attachments/assets/efd2359b-dd58-4cbc-991b-f308fe45e227

## Features

* **Structures your project** into an easy to navigate hierarchy of workpackages, experiments, samples and datasets.
* Allows **retrieval of data by name** e.g. `project['WP3.2f-XRD'] / 'XRD_data.csv`.
* Create new sample, experiment (etc.) notebooks through **custom dialogs**.
* Create notebook templates for **standardised proceedures**.
* **Browse and explore** your project through a custom browser, including previewing cell outputs, such as plots in-browser.
* No magic! Everything is stored in regular **human navigatable folders**, cloud backups etc. work as expected.

Check out the demo binder for a walkthrough of features (note this can take a little while to load):

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/0Hughman0/Cassini/HEAD?urlpath=lab/tree/Home.ipynb)
* **Structure your project** into a logical hierarchy _- no more lost data!_
* **Retreive any data from anywhere**, by name _- no more copy and pasting data here there and everywhere!_
* **Navigate and explore** your project through a fast, specialised browser _- no more endless clicking through folders!_
* **Preview summaries of experiment parameters and results**, including graphs, temperatures, volumes, weights _- no more waiting around for notebooks to launch!_
* **Define reusable templates** for proceedures and analysis _- no more copy and pasting code snippets!_

## Installation and Setup

> pip install cassini

Create a `project.py`:
Create a `cas_project.py`:

# project.py
from cassini import Project, DEFAULT_TIERS
from cassini import jlgui
# cas_project.py
from cassini import Project, DEFAULT_TIERS

project = Project(DEFAULT_TIERS, __file__)
jlgui.extend_project(project)

if __name__ == '__main__':
project.launch()
Expand All @@ -41,10 +32,10 @@ And launch it:

> python project.py

Head to [Quickstart](https://0hughman0.github.io/Cassini/latest/quickstart.html) for more info.
Head to [Quickstart](https://0hughman0.github.io/Cassini/0.3.x/) for more info.

## Contributing

Contributing guidelines are found [here](https://0hughman0.github.io/Cassini/latest/contributing.html).
Contributing guidelines are found [here](https://0hughman0.github.io/Cassini/0.3.x/contributing/).

This includes development installation instructions and codebase orientation.
50 changes: 23 additions & 27 deletions binder/Home.ipynb → binder/Introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"\n",
"This set of notebooks serves as a walkthrough of cassini and its features.\n",
" \n",
"Cassini sorts your project into a hierarchical structure, which you define your `project.py` file, which you'll find in the same folder as this notebook.\n",
"Cassini sorts your project into a hierarchical structure, which you define your `cas_project.py` file, which you'll find in the same folder as this notebook.\n",
"\n",
"From any notebook within your project, you can import the `project` object from your `project.py` file:"
"From any notebook within your project, you can import the `project` object from your `cas_project.py` file:"
]
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -30,7 +30,7 @@
}
],
"source": [
"from project import project\n",
"from cas_project import project\n",
"\n",
"print(project.project_folder)\n",
"print(project.hierarchy)"
Expand Down Expand Up @@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -98,7 +98,7 @@
" <DataSet \"WP1.1b-Images\">)"
]
},
"execution_count": 32,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -109,7 +109,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -118,7 +118,7 @@
"(<DataSet \"WP1.1b-Images\">, <DataSet \"WP1.1b-XRD\">, <DataSet \"WP1.1b-PL\">)"
]
},
"execution_count": 34,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -139,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -148,7 +148,7 @@
"WindowsPath('C:/Users/ramme/Documents/Programin/WorkingVersions/cassini/dev/binder/WorkPackages/WP1/WP1.1.ipynb')"
]
},
"execution_count": 36,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -166,16 +166,16 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Meta {'description': 'First attempt.', 'started': '29/08/2023', 'conclusion': 'Not bad! Looked a bit gray though.', 'cook_time': 100} (0.0ms)>"
"<Meta conclusion='Not bad! Looked a bit gray though.' started=datetime.datetime(2023, 8, 29, 0, 0, tzinfo=TzInfo(UTC)) description='First attempt.' cook_time=100 (0.0ms)>"
]
},
"execution_count": 37,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -193,7 +193,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -202,7 +202,7 @@
"WindowsPath('C:/Users/ramme/Documents/Programin/WorkingVersions/cassini/dev/binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1a.json')"
]
},
"execution_count": 39,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -223,15 +223,13 @@
"\n",
"Luckily Cassini creates a bunch of helpful tools to make this as easy as possible.\n",
"\n",
"First and foremost is the Cassini browser.\n",
"\n",
"This can be opened by pressing the tree button in the cassini toolbar (below the regular notebook toolbar!):\n",
"First and foremost is the Cassini Browser.\n",
"\n",
"![tree icon](images/treeIcon.PNG)\n",
"This can be opened from the Launcher. Click the plus button above to open a new tab, then scroll and click the Cassini Browser Button:\n",
"\n",
"**Next click the tree button**\n",
"![launcher icon](images/cassini-launcher.png)\n",
"\n",
"**...Once it's opened, the `Home.ipynb` tab to the right of the screen to create a split view so you can keep reading this file for more instructions!**"
"**...Once it's opened, the `Introduction.ipynb` tab to the right of the screen to create a split view so you can keep reading this file for more instructions!**"
]
},
{
Expand All @@ -244,8 +242,6 @@
"\n",
"The left is the tree browser and the right the preview panel.\n",
"\n",
"_you might find the preview panel gets hidden when the window resizes 😅... just click and drag from the right to restore its layout_\n",
"\n",
"### The Tree Browser\n",
"\n",
"#### The search box\n",
Expand All @@ -270,7 +266,7 @@
"\n",
"You can click on the names of each tier to navigate to that tier and view its children.\n",
"\n",
"The ordering of the columns can be switched by clicking on them.\n",
"The ordering of the rows can be switched by clicking on the column headers.\n",
"\n",
"### All the buttons!\n",
"\n",
Expand Down Expand Up @@ -344,6 +340,8 @@
"\n",
"**Scroll to the Meta section**\n",
"\n",
"Here you can attach meta-data to your tier.\n",
"\n",
"Additional metadata can be added by clicking the add button in the meta section. \n",
"\n",
"![newChildIcon](images/newChildIcon.PNG)\n",
Expand All @@ -368,8 +366,6 @@
"\n",
"![previewIcon](images/previewIcon.PNG)\n",
"\n",
"_... you might have to press it twice... for some reason 😅_\n",
"\n",
"In the highlights section you should see a preview of a cell output called Photo and a nice image of a slice of toast, with a caption underneath saying 'Maybe overdone a bit'!\n",
"\n",
"**Click the open button to open the `WP1.1b` notebook so we can understand how that plot got there!**\n",
Expand Down Expand Up @@ -408,7 +404,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.8.18"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions binder/Reports/NaturePaper.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion binder/WorkPackages/.wps/WP1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"Optimizing sample synthesis.\n\nThe first line of any description is taken as the 'info' which is displayed in the browser columns.","started":"29/08/2023","conclusion":"A moderate success.\n\nThe first line of the conclusion is taken as the outcome.","key":"text"}
{"description":"Optimizing sample synthesis.\n\nThe first line of any description is taken as the 'info' which is displayed in the browser columns.","started":"2023-08-28 00:00:00Z","conclusion":"A moderate success.\n\nThe first line of the conclusion is taken as the outcome.","key":"text","temperature":100}
2 changes: 1 addition & 1 deletion binder/WorkPackages/.wps/WP2.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"Integrating sample into device.\n\n*Markdown* is also _rendered_ in the tier preview panel.\n\nIncluding...\n\n$y = \\sin(x)$\n\nMaths!","started":"29/08/2023","conclusion":""}
{"description":"Integrating sample into device.\n\n*Markdown* is also _rendered_ in the tier preview panel.\n\nIncluding...\n\n$y = \\sin(x)$\n\nMaths!","started":"2023-08-29 00:00:00Z","conclusion":"","temperature":150}
4 changes: 2 additions & 2 deletions binder/WorkPackages/WP1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"source": [
"from project import project\n",
"from cas_project import project\n",
"\n",
"wp = project.env('WP1')\n",
"wp.gui.header()"
Expand All @@ -41,7 +41,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.8.18"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/.exps/WP1.1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"Replicating reported method.","started":"29/08/2023","conclusion":"Reported method is nonsense.\n\nThere must be a missing step to the synthesis.\n"}
{"description":"Replicating reported method.","started":"2023-08-28 00:00:00Z","conclusion":"Reported method is nonsense.\n\nThere must be a missing step to the synthesis.\n\nIs there something interesting that happens when this is really long, I am kinda interetted what happens. \n\nIt kinda seems like we run into some problems when this gets too long, which is kinda interesting.\n\nI am a little concerned about this and how it might go down. \n\nAlthough this seems to not be too bad in that respect, so I guess that's something! Yay!"}
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/.exps/WP1.2.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description": "Trying to use more beans.\n\nWP1.1's approach wasn't great. WP1.1d indicated could be due to a lack of beans, so going to try improving.", "started": "29/08/2023"}
{"description": "Trying to use more beans.\n\nWP1.1's approach wasn't great. WP1.1d indicated could be due to a lack of beans, so going to try improving.", "started": "2023-08-29 00:00:00Z"}
4 changes: 2 additions & 2 deletions binder/WorkPackages/WP1/WP1.1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"source": [
"from project import project\n",
"from cas_project import project\n",
"\n",
"exp = project.env('WP1.1')\n",
"exp.gui.header()"
Expand All @@ -41,7 +41,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.8.18"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1a.hlts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1a.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"First attempt.","started":"29/08/2023","conclusion":"Not bad! Looked a bit gray though.","cook_time":100}
{"description":"First attempt.","started":"2023-08-29 00:00:00Z","conclusion":"Not bad! Looked a bit gray though.","cook_time":100}
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1b.hlts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1b.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description":"Trying longer cook time.\n\nFirst attempt was good. Looked a bit gray. Will trying doing for longer.","started":"29/08/2023","cook_time":12}
{"description":"Trying longer cook time.\n\nFirst attempt was good. Looked a bit gray. Will trying doing for longer.","started":"2023-08-30 00:01:00Z","cook_time":12,"conclusion":""}
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1c.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description": "Increasing cook time.\n\n1.1b was a bit too far under.", "cook_time": "32", "started": "29/08/2023"}
{"description":"Increasing cook time.\n\n1.1b was a bit too far under.","cook_time":32,"started":"2023-09-01 00:02:00Z"}
2 changes: 1 addition & 1 deletion binder/WorkPackages/WP1/WP1.1/.smpls/WP1.1d.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"description": "Just a bit more.\n\n1.1c looking good but not quite.", "cook_time": "42", "started": "29/08/2023"}
{"description":"Just a bit more.\n\n1.1c looking good but not quite.","cook_time":42,"started":"2023-09-02 00:03:00Z"}
Loading

0 comments on commit 109b0c0

Please sign in to comment.