Skip to content

Commit fae6520

Browse files
update readme with cli instructions
1 parent 4f78dd8 commit fae6520

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

mpcontribs-lux/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,47 @@ print(pydantic_model.schema())
4242

4343
The test suite for MPContribs-lux will automatically test your `pydantic` models for arrow/parquet compatibility using the [arrowize](https://github.com/materialsproject/emmet/blob/74194bbf8c7b32ce15141bb1c9ee0527a0fc6c45/emmet-core/emmet/core/arrow.py#L40) utility from `emmet-core` (MP's production data model and data pipeline repository).
4444
Schemas submitted to MPContribs-lux do not necessarily need to be parquet/arrow compatlible, the `@arrow_incompatible` decorator from `emmet-core`'s [utils](https://github.com/materialsproject/emmet/blob/74194bbf8c7b32ce15141bb1c9ee0527a0fc6c45/emmet-core/emmet/core/utils.py#L104) module can be used to mark a `pydantic` model to be skipped during arrow compatibility testing.
45+
46+
### Quickstart from the Command Line Interface (CLI)
47+
48+
For this approach, `pip install -e 'mpcontribs-lux[cli]'` to first obtain a few extra dependencies needed to run the CLI.
49+
Once done, run the CLI with `lux project scaffold` in the `MPContribs` directory.
50+
51+
<details>
52+
<summary>
53+
This will start a series of prompts asking how to structure your project:
54+
</summary>
55+
56+
```shell
57+
/path/to/MPContribs > lux project scaffold
58+
Name space for user project: JohnDoe
59+
Structure of user project [directory, module]: module
60+
Project names to scaffold in user project name space (space-separated list): project-1 project-2 project-3
61+
Include analysis module? [y/N]: y
62+
Include pipeline module? [y/N]: n
63+
Include project README.md? [y/N]: y
64+
Include file for extra python requirements/libraries? [y/N]: y
65+
The following project scaffold will be created in 'mpcontribs-lux.mpcontribs.projects':
66+
JohnDoe
67+
├── project-1
68+
│ ├── __init__.py
69+
│ ├── analysis_1.py
70+
│ ├── pip-extra-requirements.txt
71+
│ ├── README.md
72+
│ └── schema_1.py
73+
├── project-2
74+
│ ├── __init__.py
75+
│ ├── analysis_1.py
76+
│ ├── pip-extra-requirements.txt
77+
│ ├── README.md
78+
│ └── schema_1.py
79+
└── project-3
80+
├── __init__.py
81+
├── analysis_1.py
82+
├── pip-extra-requirements.txt
83+
├── README.md
84+
└── schema_1.py
85+
Proceed? y/N [y/N]:
86+
```
87+
88+
</details>

mpcontribs-lux/mpcontribs/lux/cli/project/scaffold.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def scaffold(
2727
user_space = click.prompt("Name space for user project")
2828
structure = click.prompt("Structure of user project [directory, module]")
2929
projects = click.prompt(
30-
"Project names to scaffold in user project name space"
30+
"Project names to scaffold in user project name space (space-separated list)"
3131
).split(" ")
3232
include_analysis = click.confirm("Include analysis module?")
3333
include_pipeline = click.confirm("Include pipeline module?")

0 commit comments

Comments
 (0)