Skip to content

Commit

Permalink
Configure GitHub Codespace (#297)
Browse files Browse the repository at this point in the history
* add .devcontainer/devcontainer.json with codespace config

* add "Launch Codespace" buttons to readme example table

* remove dscribe from project.optional-dependencies.server

dscribe was the cause of install errors in `pip install .[server]` causing codespace spin up to fail
  • Loading branch information
janosh authored Nov 29, 2022
1 parent 7b2be28 commit f21aa59
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"waitFor": "onCreateCommand",
"updateContentCommand": "pip install .[server]",
"customizations": {
"codespaces": {
"openFiles": [
"crystal_toolkit/apps/examples/basic_hello_structure_interactive.py"
]
},
"vscode": {
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
}
}
}
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Crystal Toolkit

# Call for new contributors
## Call for new contributors

Crystal Toolkit is an academic project. A manuscript is in preparation to detail the design goals of Crystal Toolkit and achievements to date.

Expand All @@ -21,25 +21,26 @@ Following a discussion with a potential contributor, "new contributor" issues ar

## Example Apps

| Description | Link    |
| :--------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`bandstructure.py`**<br> Demonstrates capabilities of the `BandstructureAndDosComponent` component | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/bandstructure.py) |
| **`basic_hello_structure.py`**<br> Uses `StructureMoleculeComponent` to show a simple `pymatgen` structure | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_structure.py) |
| **`basic_hello_structure_interactive.py`**<br> Adds a button to the `basic_hello_structure.py` to toggle between two structures interactively | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_structure_interactive.py) |
| **`basic_hello_world.py`**<br> Bare-bones example showing how to render the text "Hello scientist!" in Dash app | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_world.py) |
| **`diffraction.py`**<br> Demonstrates capabilities of the `XRayDiffractionComponent` component | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction.py) |
| **`diffraction_dynamic.py`**<br> Adds a button to `diffraction.py` to load a new structure on the fly | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction_dynamic.py) |
| **`diffraction_empty.py`**<br> Shows `XRayDiffractionComponent` can be mounted without a passing structure | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction_empty.py) |
| **`kwarg_inputs.py`**<br> Shows off boolean input (aka toggle), matrix input and slider input components | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/kwarg_inputs.py) |
| **`phase_diagram.py`**<br> Combines `MPRester.get_entries_in_chemsys()` and the `PhaseDiagram` component to plot the Li-O-Co convex hull | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/phase_diagram.py) |
| **`pourbaix.py`**<br> Combines `MPRester.get_pourbaix_entries()` and the `PourbaixDiagramComponent` to plot the Fe-CO Pourbaix diagram | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/pourbaix.py) |
| **`structure.py`**<br> Show cases multiple layout options for the `StructureMoleculeComponent` | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/structure.py) |
| **`structure_magnetic.py`**<br> Plots a structure with magnetic moments | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/structure_magnetic.py) |
| **`transformations.py`**<br> Combines `StructureMoleculeComponent` and `AllTransformationsComponent` to apply interactive structure transformations | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/transformations.py) |
| **`transformations_minimal.py`**<br> Shows how to restrict the types of allowed transformations | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/transformations_minimal.py) |
| **`write_structure_screenshot_to_file.py`**<br> Shows to save interactive structure views as image files | [![View on GitHub]](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/write_structure_screenshot_to_file.py) |

[View on GitHub]: https://img.shields.io/badge/View%20on-GitHub-darkblue?logo=github
| Description | &emsp;&emsp;&emsp;&emsp;&emsp; |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| [bandstructure.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/bandstructure.py)<br> Demonstrates capabilities of the `BandstructureAndDosComponent` component | [![Launch Codespace]][create codespace] |
| [basic_hello_structure.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_structure.py)<br> Uses `StructureMoleculeComponent` to show a simple `pymatgen` structure | [![Launch Codespace]][create codespace] |
| [basic_hello_structure_interactive.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_structure_interactive.py)<br> Adds a button to the `basic_hello_structure.py` to toggle between two structures interactively | [![Launch Codespace]][create codespace] |
| [basic_hello_world.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/basic_hello_world.py)<br> Bare-bones example showing how to render the text "Hello scientist!" in Dash app | [![Launch Codespace]][create codespace] |
| [diffraction.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction.py)<br> Demonstrates capabilities of the `XRayDiffractionComponent` component | [![Launch Codespace]][create codespace] |
| [diffraction_dynamic.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction_dynamic.py)<br> Adds a button to `diffraction.py` to load a new structure on the fly | [![Launch Codespace]][create codespace] |
| [diffraction_empty.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/diffraction_empty.py)<br> Shows `XRayDiffractionComponent` can be mounted without a passing structure | [![Launch Codespace]][create codespace] |
| [kwarg_inputs.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/kwarg_inputs.py)<br> Shows off boolean input (aka toggle), matrix input and slider input components | [![Launch Codespace]][create codespace] |
| [phase_diagram.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/phase_diagram.py)<br> Combines `MPRester.get_entries_in_chemsys()` and the `PhaseDiagram` component to plot the Li-O-Co convex hull | [![Launch Codespace]][create codespace] |
| [pourbaix.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/pourbaix.py)<br> Combines `MPRester.get_pourbaix_entries()` and the `PourbaixDiagramComponent` to plot the Fe-CO Pourbaix diagram | [![Launch Codespace]][create codespace] |
| [structure.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/structure.py)<br> Show cases multiple layout options for the `StructureMoleculeComponent` | [![Launch Codespace]][create codespace] |
| [structure_magnetic.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/structure_magnetic.py)<br> Plots a structure with magnetic moments | [![Launch Codespace]][create codespace] |
| [transformations.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/transformations.py)<br> Combines `StructureMoleculeComponent` and `AllTransformationsComponent` to apply interactive structure transformations | [![Launch Codespace]][create codespace] |
| [transformations_minimal.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/transformations_minimal.py)<br> Shows how to restrict the types of allowed transformations | [![Launch Codespace]][create codespace] |
| [write_structure_screenshot_to_file.py](https://github.com/materialsproject/crystaltoolkit/blob/main/crystal_toolkit/apps/examples/write_structure_screenshot_to_file.py)<br> Shows to save interactive structure views as image files | [![Launch Codespace]][create codespace] |

[Launch Codespace]: https://img.shields.io/badge/Launch-Codespace-darkblue?logo=github
[create codespace]: https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=98350025

## Team and Contribution Policy

Expand Down
2 changes: 1 addition & 1 deletion crystal_toolkit/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2022.11.29"
__version__ = "2022.11.29"
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ developers to easily make an interactive web app to display materials science in
showcase of the framework’s capabilities, the Crystal Toolkit app allows you to import, view,
analyze and transform crystal structures and molecules."""
readme = "README.md"
license = {file = "LICENSE"}
license = { file = "LICENSE" }
requires-python = ">=3.8,<3.11"
authors = [{name = "Matt Horton", email = "mkhorton@lbl.gov"}]
authors = [{ name = "Matt Horton", email = "mkhorton@lbl.gov" }]

dependencies = [
"pymatgen",
"webcolors",
"crystaltoolkit-extension",
"shapely",
"scikit-learn",
"scikit-image"
"scikit-image",
]

[project.optional-dependencies]
Expand All @@ -30,8 +30,7 @@ server = [
"robocrys",
"habanero",
"hiphive",
"dscribe",
"dash-extensions<=0.1.5"
"dash-extensions<=0.1.5",
]
fermi = ["ifermi", "pyfftw"]
vtk = ["dash-vtk"]
Expand All @@ -44,7 +43,7 @@ dev = [
"sphinx_rtd_theme",
"recommonmark",
"dephell",
"jinja2<3.1"
"jinja2<3.1",
]

[project.urls]
Expand Down

0 comments on commit f21aa59

Please sign in to comment.