Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
run on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam D committed Jun 16, 2021
1 parent 7817545 commit 9a6c4c6
Show file tree
Hide file tree
Showing 47 changed files with 2,979 additions and 2,775 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,68 +9,68 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- uses: actions/[email protected]
with:
python-version: 3.7
- uses: actions/[email protected]
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm wheel
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools setuptools_scm wheel
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPY_API_TOKEN }}
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPY_API_TOKEN }}

docs:
runs-on: ubuntu-latest
needs:
- deploy
- deploy

steps:
- uses: actions/checkout@v2

- uses: actions/[email protected]
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-docs.txt
pip install -e .
- name: Generate changelog
uses: charmixer/auto-changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "materialsproject"
mv CHANGELOG.md docs/
git add docs/CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: mkdocs build

- name: Deploy
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./site
- uses: actions/checkout@v2

- uses: actions/[email protected]
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-docs.txt
pip install -e .
- name: Generate changelog
uses: charmixer/auto-changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "materialsproject"
mv CHANGELOG.md docs/
git add docs/CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: mkdocs build

- name: Deploy
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./site
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- uses: actions/[email protected]
with:
python-version: 3.8
- uses: actions/[email protected]
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
run: mkdocs build
- name: Build
run: mkdocs build

merge-deps:
needs:
Expand All @@ -49,17 +49,17 @@ jobs:
- uses: actions/[email protected]
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build
run: mkdocs build

- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
publish_dir: ./site
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ for such Enhancements, then you hereby grant the following license:
a non-exclusive, royalty-free perpetual license to install, use,
modify, prepare derivative works, incorporate into other computer
software, distribute, and sublicense such enhancements or derivative
works thereof, in binary and source code form.
works thereof, in binary and source code form.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# Materials Project Documentation

!!! warning
Migration of content from our wiki
([https://www.materialsproject.org/wiki](
https://www.materialsproject.org/wiki)) is underway. Until this notice is
removed, please go there (or use documentation links on
[https://materialsproject.org/](https://materialsproject.org/)) for
up-to-date documentation.
Migration of content from our wiki
([https://www.materialsproject.org/wiki](https://www.materialsproject.org/wiki)) is underway. Until this notice is
removed, please go there (or use documentation links on
[https://materialsproject.org/](https://materialsproject.org/)) for
up-to-date documentation.

This is a place for all documentation relating to the
[Materials Project](https://materialsproject.org) (MP), encompassing:

* Foundations: concepts in materials and computer science that structure and
aid interpretation of our data sets
* Case Studies: Examples of materials analysis and design using our
data and tools
* Productivity: Using our website, application programming interface (API),
and codebases.
* Reproducibility: How we generate and validate our computed data sets
* Contribution: Developer guides and design specifications

If you notice an error or omission, please post an [issue](
https://github.com/materialsproject/docs/issues/new) or suggest an
- Foundations: concepts in materials and computer science that structure and
aid interpretation of our data sets
- Case Studies: Examples of materials analysis and design using our
data and tools
- Productivity: Using our website, application programming interface (API),
and codebases.
- Reproducibility: How we generate and validate our computed data sets
- Contribution: Developer guides and design specifications

If you notice an error or omission, please post an [issue](https://github.com/materialsproject/docs/issues/new) or suggest an
edit to us via a Pull Request.

Thanks,
Thanks,
Materials Project Team

# Contributing
Expand All @@ -37,19 +35,25 @@ We use [MkDocs](https://www.mkdocs.org/), a static site generator for project do
Fork this repository and then clone it to your computer.

Create a Python 3 environment for this project and activate it. Example flow using `conda`:

```
$ conda create -n mpdocs python=3
$ conda activate mpdocs
```

Navigate to the folder of your cloned repository, and install dependencies:

```
(mpdocs)$ pip install -r requirements.txt
```

Start the development server:

```
(mpdocs)$ mkdocs serve
```
Open [http://127.0.0.1:8000/]( http://127.0.0.1:8000/) to preview the site and see changes as you make them.

Open [http://127.0.0.1:8000/](http://127.0.0.1:8000/) to preview the site and see changes as you make them.

Create a new git branch to record any changes. When you push your branch to GitHub, you can then initiate a Pull
Request against the `master` branch of this repo.
Request against the `master` branch of this repo.
2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docs.materialsproject.org
docs.materialsproject.org
7 changes: 4 additions & 3 deletions docs/contrib/spec/newsfeed.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Newsfeed

!!! info
This page is a *design specification* for a feature that was implemented and
tested before release.
This page is a _design specification_ for a feature that was implemented and
tested before release.

The [MP website](//materialsproject.org) exposes a lot of data and tools.
Sometimes, people are surprised to learn about data and tools that have been
Expand Down Expand Up @@ -50,7 +50,6 @@ format) should be added -- do not change the filename. If a change to the entry
is insignificant, like fixing a typo, then you don't need to create or update an
`updated` field.


## Data display

The news feed is displayed in two places: on the static (not-signed-in) home
Expand All @@ -70,12 +69,14 @@ items are presented in reverse chronological order.

The last time a user has seen the newsfeed is stored in the `app_db`'s
`newsfeed_views` collection, one document per user. The query

```python
return_document = app_db.newsfeed_views.find_one_and_update(
{"user": request.user.username},
{"$set": {"last_seen": datetime.utcnow()},
upsert=True)
```

will update a user's document (inserting a document if one doesn't exist) with
the current time as the last-seen time, and return the old user document (or
`None` if no document existed). The application can then determine which
Expand Down
Loading

0 comments on commit 9a6c4c6

Please sign in to comment.