Skip to content

Commit d19b902

Browse files
authored
Merge branch 'ExaWorks:main' into main
2 parents 9ff6642 + 3154be3 commit d19b902

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+814
-3149
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ details how to contribute in a standardized and efficient manner.
88

99
## Git Workflow Summary
1010

11-
- Ensure that you've opened an Issue on Github and consensus around the
12-
solution has be reached.
11+
- Ensure that you've opened an Issue on GitHub and consensus around the
12+
solution has been reached.
1313
- Minor changes (e.g., grammatical fixes) do not require an Issue first.
14-
- Make a new branch for each separable set of changes["one task, one
15-
branch"](https://mail.python.org/pipermail/ipython-dev/2010-October/005632.html).
16-
- [Each commit should make one change](https://dev.to/ruanbrandao/how-to-make-good-git-commits-256k).
17-
to aide reviewing and (in the worst case) simplify reverting it in the future.
14+
- Make a new branch for each separable set of changes["one task, one
15+
branch."](https://mail.python.org/pipermail/ipython-dev/2010-October/005632.html).
16+
- [Each commit should make one change](https://dev.to/ruanbrandao/how-to-make-good-git-commits-256k)
17+
to aid reviewing and (in the worst case) simplify reverting it in the future.
1818
- A patch commit message should consist of a single short (less than 50
1919
character) sentence summarizing the change, optionally followed by a blank line
2020
and then a more thorough description.
@@ -25,16 +25,16 @@ details how to contribute in a standardized and efficient manner.
2525
- If you do find yourself merging from upstream, consider [Rebasing on
2626
upstream](https://matplotlib.org/stable/devel/gitwash/development_workflow.html#rebase-on-trunk).
2727
- Submit a Pull Request from your feature branch against upstream.
28-
- Use the Draft PR feature on Github or title your PR with `WIP` if your PR is
28+
- Use the Draft PR feature on GitHub or title your PR with `WIP` if your PR is
2929
not ready for a complete review immediately upon submission.
30-
- Ask on the [Exaworks slack](https://exaworks.slack.com) if you get stuck.
30+
- Ask on the [Exaworks Slack](https://exaworks.slack.com) if you get stuck.
3131

3232

3333
## Pull Request (PR) Merging Process
3434

3535
- PR reviews should be timely. Both reviewer and PR issuer should make a good
3636
attempt at resolving the conversation as quickly as possible.
37-
- PR reviews exist to check obvious things aren't missed, not to achieve
37+
- PR reviews exist to check that obvious things aren't missed, not to achieve
3838
perfection.
3939
- A PR is eligible for merging if it has at least one approval from a
4040
project maintainer, no outstanding requested changes or discussions, and passes
@@ -55,16 +55,16 @@ under-the-hood. PEP8 compliance is also verified as part of the CI by `flake8`.
5555

5656
## Type Annotations
5757

58-
As much python code in this repo as is feasible should include type annotations.
58+
As much Python code in this repo as is feasible should include type annotations.
5959
These type annotations can then be ingested and checked by `mypy`, which can be
6060
run with `make typecheck` and `make checks`.
6161

6262
## Docstrings
6363

64-
As many public python interfaces in this repo as is feasible should
64+
As many public Python interfaces in this repo as is feasible should
6565
include docstring documentation. All docstrings should follow the
6666
[numpy format](https://numpydoc.readthedocs.io/en/latest/format.html). These
6767
docstrings are automatically parsed by Sphinx and turned into html-based
6868
documentation hosted on readthedocs. Document generation can be run locally
6969
with `make docs`. For more details about building the documentation, please
70-
see [`README-dev`][README-dev.md].
70+
see [`README-dev`](README-dev.md).

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ docs:
5151
.PHONY: web-docs
5252
web-docs:
5353
rm -rf docs/.generated
54-
sphinx-build -W -b html -D html_theme='cloud' docs docs/.web-build/
54+
sphinx-build -W -b html -D html_theme='cloud' -D templates_path='_templates' docs docs/.web-build/
5555

5656
.PHONY: style
5757
style:

QuickStart.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Quick start guide
1+
# Quick Start Guide
22

33
This document will guide you through the install procedure and your first hello world example.
44

@@ -17,9 +17,9 @@ If you have conda installed you might want to start from a fresh environment. Th
1717
2. `conda activate psij`
1818

1919

20-
Install psij from the github repository:
20+
Install psij from the GitHub repository:
2121

22-
1. Clone repository into your working directory:
22+
1. Clone the repository into your working directory:
2323

2424
`git clone https://github.com/ExaWorks/psij-python.git`
2525

@@ -32,15 +32,15 @@ Install psij from the github repository:
3232

3333

3434

35-
## Hello world
35+
## Hello World
3636

3737
**Requirements**
3838
- python3.7
39-
- job executioner, e.g. slurm in this example
39+
- Job executor, e.g. Slurm in this example
4040

4141
**Steps**
4242

43-
1. Create a file *my-workflow.py* and copy and paste the code below:
43+
1. Create a file *my-workflow.py* and copy and paste this code:
4444

4545
```python
4646

@@ -82,7 +82,6 @@ for i in range(N):
8282
jobs[i].wait()
8383

8484
```
85-
2. In this example the number of jobs is 1. Set *N* to the number of jobs you want to run and save file.
85+
2. In this example the number of jobs is 1. Set *N* to the number of jobs you want to run and save the file.
8686

8787
3. `python my-workflow.py`
88-

README-dev.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
There are two ways to build the documentation. One is the plain one, where
66
the plain Sphinx output is desired, and the other is the themed version that
7-
is meant to integrate with the web site.
7+
is meant to integrate with the website.
88

99
!!! Note
1010

@@ -30,41 +30,49 @@ The output will be in `docs/.build`
3030

3131
### Building the Themed Documentation
3232

33-
This builds the themed version of the docs as well as the web site. The steps
33+
This builds the themed version of the docs as well as the website. The steps
3434
are:
3535

3636
1. Make sure you have the dependencies installed:
3737
```sh
3838
pip install -r requirements-docs.txt
3939
```
4040

41-
2. Build the web site, which builds the themed version of the documentation
41+
2. Build the website, which builds the themed version of the documentation
4242
automatically:
4343
```
4444
web/build.sh
4545
```
4646

4747
Make sure that `build.sh` is called from the main directory. The output will
48-
be in `web-build`. You are likely going to need to load it through a web
49-
server. A simple way to do so is:
48+
be in `web-build`.
49+
50+
3. Render the web site and themed documentation, which can be done using Jekyll.
51+
To install Jekyll, follow the instructions in step 2 of
52+
[web/README.md](web/README.md). You only need to do this once. Then run
5053

5154
```
52-
cd web-build
53-
python -m http.server <port>
55+
web/serve.sh
5456
```
5557

56-
where `<port>` is a port number to start the HTTP server on.
58+
which will output something like this:
59+
```
60+
...
61+
Server address: http://127.0.0.1:4000/psij-python/
62+
Server running... press ctrl-c to stop.
63+
```
64+
5765
58-
When developing the web site, a convenient script is `web/watch.sh`, which can
59-
monitor the source directories and re-build when files are modified. This
60-
requires `inotify` which may or may not be available on your platform.
66+
Pointing your web browser to the URL printed by Jekyll will show the PSI/J
67+
web site. The themed documentation will be found under the "Documentation"
68+
tab.
6169
6270
63-
### Release process
71+
### Release Process
6472
6573
Here are the steps for putting out a fresh release to Pypi.
6674
67-
1. Create a new branch from main, and make release specific updates:
75+
1. Create a new branch from main and make release specific updates:
6876
* Update `src/psij/version.py` to the new version number
6977
7078
2. Use the standard PR process and get changes from the above step merged to main.
@@ -73,6 +81,6 @@ Here are the steps for putting out a fresh release to Pypi.
7381
setup tokens on your machine.
7482
7583
4. Run `make VERSION="version string" tag-and-release`. This will:
76-
1. Create and push tags to github
77-
2. Build the package
78-
3. Push built package to Pypi.
84+
* Create and push tags to GitHub.
85+
* Build the package.
86+
* Push built package to Pypi.

README-testing.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ are uploaded to a test aggregation service. The compatibility of various
1010
PSI/J branches with various resources can then be assessed and is
1111
available at https://testing.exaworks.org
1212

13-
How to run tests
13+
How to Run Tests
1414
================
1515

1616
There are a number of ways to run tests. Invoking `pytest` directly,
17-
running the integration tests and through `cron` (or a similar tool).
17+
running the integration tests, and through `cron` (or a similar tool).
1818

19-
Setting up an automated testing job
19+
Setting up an Automated Testing Job
2020
===================================
2121

22-
This is the preferred way of running the tests since it allows the PSI/J
22+
This is the preferred way of running tests since it allows the PSI/J
2323
team to keep a constant eye on the state of the library on various
2424
resources. To set up the Cron job (or an alternative method), you can either
2525
use the provided setup script:
@@ -37,7 +37,7 @@ virtual environment, please run the relevant commands before invoking
3737
`psij-ci-setup`.
3838

3939

40-
Testing with the CI runner
40+
Testing with the CI Runner
4141
==========================
4242

4343
The CI runner is a convenience script which can clone the PSI/J
@@ -106,4 +106,3 @@ or, using `make`, prefix all options with a double dash ("--"):
106106
Care must, however, be taken since it is impossible to preserve
107107
whitespace and certain special characters (such as the double quotes)
108108
when passing arguments through `make`.
109-

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ documentation](https://exaworks.org/psij-python/#docs).
1414

1515
## Introduction
1616

17-
1. [Quick start guide](QuickStart.md)
18-
2. [Workflow examples](scripts/WORKFLOW-EXAMPLES.md)
19-
3. [Setting up tests](README-testing.md)
20-
4. [How to contribute](CONTRIBUTING.md)
21-
5. [Building the documentation](README-dev.md)
17+
1. [Quick Start Guide](QuickStart.md)
18+
2. [Workflow Examples](scripts/WORKFLOW-EXAMPLES.md)
19+
3. [Setting up Tests](README-testing.md)
20+
4. [How to Contribute](CONTRIBUTING.md)
21+
5. [Building the Documentation](README-dev.md)

docs/README-selectors.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ selector. The string `"<&executor-type>"` must be a standalone token as
2626
far as the syntax highlighter is concerned. That is, it probably won't
2727
work if it's in a comment.
2828

29+
An alternative string to `"<&executor-type>"` is `execparams.executor`.
30+
This so that one could have statements of the form
31+
32+
x = f(execparams.executor)
33+
34+
works with the selector mechanism. This would allow rendering of
35+
verbatim functional test cases that parametrize the executor types and
36+
representing them with selectors in the documentation.
37+
2938
To add alternative code blocks, use:
3039

3140
```Sphinx

docs/_static/extras.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,28 @@ function detectAll(selectorType) {
5959
// Similarly, if "D" is selected in the second selector, we only want to change
6060
// simple_value_2. However, if either "B" or "C" are selected in either selector,
6161
// we want to change both.
62-
62+
63+
console.log("type:" + selectorType);
6364
$("p." + selectorType + "-selector").addClass(selectorType + "-item");
65+
var prevSpans = [];
6466
$("span").each(function() {
65-
if ($(this).text() == '"<&' + selectorType + '>"') {
67+
var text = $(this).text();
68+
// look for both "<&<type>>" and execparams.<type> to align with test cases
69+
70+
if (text == '"<&' + selectorType + '>"') {
6671
$(this).addClass(selectorType + "-item").addClass("psij-selector-value");
6772
}
73+
if (text == "executor" && prevSpans.length == 2
74+
&& prevSpans[0].text() == "execparams" && prevSpans[1].text() == '.') {
75+
// remove <span>execparams</span> and <span>.</span>
76+
prevSpans[0].remove();
77+
prevSpans[1].remove();
78+
$(this).addClass(selectorType + "-item").addClass("psij-selector-value");
79+
}
80+
prevSpans.push($(this));
81+
if (prevSpans.length > 2) {
82+
prevSpans.shift();
83+
}
6884
});
6985
}
7086

docs/_templates/layout.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{%- extends "cloud/layout.html" -%}
2+
3+
{# We are not processing the output of these pages through Jekyll, so
4+
we need to set the variables referenced in the includes. #}
5+
{% set site = {"baseurl": "/psij-python"} %}
6+
7+
{% block scripts %}
8+
{% include "../../web/_includes/head.html" %}
9+
10+
{{ super() }}
11+
{% endblock %}
12+
13+
{% block header %}
14+
<v-app id="psij-app">
15+
{% include "../../web/_includes/menu.html" %}
16+
{{ super() }}
17+
{% endblock %}
18+
19+
{% block footer %}
20+
{{ super() }}
21+
22+
{% include "../../web/_includes/footer.html" %}
23+
</v-app>
24+
25+
{# Same as above #}
26+
{% set page = {"tab": 2} %}
27+
{% include "../../web/_includes/vueinit.html" %}
28+
29+
30+
{% endblock %}
31+
32+
33+
{% block sidebartoggle %}
34+
{% endblock %}

docs/_templates/searchbox.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{#
2+
searchbox.html
3+
~~~~~~~~~~~~~~~~~~~~
4+
5+
Replaces basic/searchbox.html because vue.js does not like <script> without the type attribute
6+
#}
7+
{%- if pagename != "search" and builder != "singlehtml" %}
8+
<div id="searchbox" style="display: none" role="search">
9+
<h3 id="searchlabel">{{ _('Quick search') }}</h3>
10+
<div class="searchformwrapper">
11+
<form class="search" action="{{ pathto('search') }}" method="get">
12+
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
13+
<input type="submit" value="{{ _('Go') }}" />
14+
</form>
15+
</div>
16+
</div>
17+
<script type="application/javascript">$('#searchbox').show(0);</script>
18+
{%- endif %}

0 commit comments

Comments
 (0)