Skip to content

Commit

Permalink
Merge pull request #20 from cesmix-mit/refactor
Browse files Browse the repository at this point in the history
First refactoring iteration
  • Loading branch information
emmanuellujan authored Jul 15, 2022
2 parents 5782e74 + aa64617 commit b0b98ac
Show file tree
Hide file tree
Showing 24 changed files with 1,191 additions and 29 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
tags: '*'
tags: "*"
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand All @@ -13,8 +13,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- 'nightly'
- "1.7"
os:
- ubuntu-latest
- macOS-latest
Expand All @@ -37,32 +36,18 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: add CESMIX registry
run: |
julia -e '
using Pkg
Pkg.Registry.add("General")
Pkg.Registry.add(RegistrySpec(url = "https://github.com/cesmix-mit/CESMIX.git"))
Pkg.Registry.add(RegistrySpec(url = "https://github.com/JuliaMolSim/MolSim.git"))
'
shell: bash
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using PotentialLearning
DocMeta.setdocmeta!(PotentialLearning, :DocTestSetup, :(using PotentialLearning); recursive=true)
doctest(PotentialLearning)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
49 changes: 49 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Documentation
on:
pull_request:
push:
branches:
- main
tags: "*"
jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- uses: julia-actions/setup-julia@v1
with:
version: "1.7"
- name: add CESMIX registry
run: |
julia -e '
using Pkg
Pkg.Registry.add("General")
Pkg.Registry.add(RegistrySpec(url = "https://github.com/cesmix-mit/CESMIX.git"))
Pkg.Registry.add(RegistrySpec(url = "https://github.com/JuliaMolSim/MolSim.git"))
'
shell: bash
- name: instantiate docs
run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
'
- name: run doctests
run: |
julia --project=docs -e '
using Pkg
Pkg.activate("./")
Pkg.add("Documenter")
using Documenter: DocMeta, doctest
using PotentialLearning
DocMeta.setdocmeta!(PotentialLearning, :DocTestSetup, :(using PotentialLearning); recursive=true)
doctest(PotentialLearning)
'
- name: generate docs
run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
26 changes: 26 additions & 0 deletions .github/workflows/PreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Manifest.toml

# generated docs
docs/build/
docs/src/generated/
30 changes: 30 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name = "PotentialLearning"
uuid = "82b0a93c-c2e3-44bc-a418-f0f89b0ae5c2"
authors = ["CESMIX Team"]
version = "0.1.0"

[deps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
GalacticOptim = "a75be94c-b780-496d-a8a9-0878b188d577"
InteratomicBasisPotentials = "37c59853-c2ad-4e3a-930c-a41b2395fb19"
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LAMMPS = "ee2e13b9-eee9-4449-aafa-cfa6a2dbe14d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
julia = "1.7"
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
## [WIP] PotentialLearning.jl: an open source library for the active learning and fast calculation of interatomic potentials in atomistic simulations of materials.
## [WIP] PotentialLearning.jl

Developed as part of [CESMIX](https://cesmix.mit.edu).
An open source library for the active learning and fast calculation of interatomic potentials in atomistic simulations of materials.

<!-- Information badges -->
<p align="center">
<a href="https://mit-license.org">
<img alt="MIT license" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square">
</a>
<a href="https://github.com/cesmix-mit/PotentialLearning.jl/issues/new">
<img alt="Ask us anything" src="https://img.shields.io/badge/Ask%20us-anything-1abc9c.svg?style=flat-square">
</a>
<a href="https://github.com/cesmix-mit/PotentialLearning.jl/releases">
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/cesmix-mit/PotentialLearning.jl?include_prereleases&label=latest%20version&logo=github&sort=semver&style=flat-square">
</a>
</p>

This package is currently being refactored. See [Atomistic Composable Workflows](https://github.com/cesmix-mit/AtomisticComposableWorkflows) for current Julia case studies.
<!-- CI and documentation badges -->
<p align="center">
<a href="https://cesmix-mit.github.io/PotentialLearning.jl/stable">
<img alt="Stable documentation" src="https://img.shields.io/badge/documentation-stable%20release-blue?style=flat-square">
</a>
<a href="https://cesmix-mit.github.io/PotentialLearning.jl/dev">
<img alt="Development documentation" src="https://img.shields.io/badge/documentation-in%20development-orange?style=flat-square">
</a>
</p>


Developed as part of [CESMIX](https://cesmix.mit.edu).

See [Atomistic Composable Workflows](https://github.com/cesmix-mit/AtomisticComposableWorkflows) for current Julia case studies.


7 changes: 7 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Empty file added docs/citation.bib
Empty file.
49 changes: 49 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..")) # add PotentialLearning to environment stack

using PotentialLearning
using Documenter
using DocumenterCitations
using Literate

DocMeta.setdocmeta!(PotentialLearning, :DocTestSetup, :(using PotentialLearning); recursive = true)

bib = CitationBibliography(joinpath(@__DIR__, "citations.bib"))

# Generate examples

#const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
#const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")

#examples = Pair{String,String}[]

#for (_, name) in examples
# example_filepath = joinpath(EXAMPLES_DIR, string(name, ".jl"))
# Literate.markdown(example_filepath, OUTPUT_DIR, documenter = true)
#end

#examples = [title => joinpath("generated", string(name, ".md")) for (title, name) in examples]

makedocs(bib;
modules = [PotentialLearning],
authors = "CESMIX-MIT",
repo = "https://github.com/cesmix-mit/PotentialLearning.jl/blob/{commit}{path}#{line}",
sitename = "PotentialLearning.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://cesmix-mit.github.io/PotentialLearning.jl",
assets = String[],
),
pages = [
"Home" => "index.md",
"API" => "api.md",
],
doctest = true,
linkcheck = true,
strict = false
)

deploydocs(;
repo = "github.com/cesmix-mit/PotentialLearning.jl",
devbranch = "main",
push_preview = true
)
9 changes: 9 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# API Reference

This page provides a list of all documented types and functions and in PotentialLearning.jl.


```@autodocs
Modules = [PotentialLearning]
Order = [:type, :function, :constant]
```
2 changes: 2 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# PotentialLearning.jl

1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See https://github.com/cesmix-mit/AtomisticComposableWorkflows
Loading

0 comments on commit b0b98ac

Please sign in to comment.