Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.5 #248

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

v0.5 #248

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: julia-actions/julia-buildpkg@latest

- name: install dependencies
run: julia --project --color=yes -e 'import Pkg; Pkg.add.(["FIGlet", "Coverage"])'
run: julia --project --color=yes -e 'import Pkg; Pkg.add.(["Coverage"])'

- name: run tests
run: julia --project --color=yes --code-coverage -e 'import Pkg; Pkg.test(coverage=true)'
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: formatter

on:
pull_request:
branches: [ master ]

concurrency: # only allow the most recent workflow to execute
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env: # environment variables
julia_version: '1.8.2' # julia version to use on all runners (except cross-platform-julia)

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: julia-actions/setup-julia@latest
with:
version: ${{ env.julia_version }}

- uses: actions/checkout@main

- name: Install JuliaFormatter
run: julia -e 'using Pkg; Pkg.add("JuliaFormatter")'

- name: Run JuliaFormatter
run: |
julia -e '
using JuliaFormatter;
format(
".",
verbose=true,
always_for_in=true,
whitespace_typedefs=true,
whitespace_ops_in_indices=true,
remove_extra_newlines=true,
short_to_long_function_def=true,
long_to_short_function_def=true,
always_use_return=true,
whitespace_in_kwargs=false,
format_docstrings=true,
conditional_to_if=true,
normalize_line_endings="unix",
trailing_comma=false,
separate_kwargs_with_semicolon=true,
format_markdown=true
)'

- name: Formatting Check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'

- if: ${{ failure() }}
id: cpr
name: Formatting PR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ steps.vars.outputs.branch }}
commit-message: JuliaFormatter Action Bot
title: 'Automatic JuliaFormatter.jl run'
branch: auto-juliaformatter-pr
delete-branch: true
labels: formatting, automated pr, no changelog

- if: ${{ failure() }}
name: comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
message: 'Code formatting requirements not met. See PR #${{ steps.cpr.outputs.pull-request-number }}'
pr_number: ${{ github.event.issue.number }}
comment_includes: "Code formatting requirements not met. See PR #"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file removed PMlogo.pdf
Binary file not shown.
Binary file removed PorousMaterialsLogo.png
Binary file not shown.
28 changes: 10 additions & 18 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name = "PorousMaterials"
uuid = "68953c7c-a3c7-538e-83d3-73516288599e"
authors = ["SimonEnsemble <[email protected]>"]
version = "0.4.2"
version = "0.5.0"

[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FIGlet = "3064a664-84fe-4d92-92c7-ed492f3d8fae"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
PrecompileSignatures = "91cefc8d-f054-46dc-8f8c-26e11d7c5411"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -24,31 +22,25 @@ Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Xtals = "ede5f01d-793e-4c47-9885-c447d1f18d6d"

[compat]
Aqua = "0.5.5"
CSV = "0.10.4"
Aqua = "0.5"
CSV = "0.10"
DataFrames = "1"
FIGlet = "0.2.1"
FileIO = "1"
Graphs = "1"
JLD2 = "0.4.22"
JLD2 = "0.4"
OffsetArrays = "1"
Optim = "1"
Polynomials = "3"
PrecompileSignatures = "3"
ProgressMeter = "1"
Reexport = "1"
Roots = "2"
SpecialFunctions = "2"
StatsBase = "0.33.16"
Xtals = "0.4"
julia = "1.7, 1.8"
StatsBase = "0.34"
Xtals = "0.5"
julia = "1.6"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Documenter"]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![PorousMaterials.jl](PMlogo.png)
![PorousMaterials.jl](logo.png)

| **Documentation** | **DOI** | **Build Status** | **Test Coverage** |
|:---:|:---:|:---:|:---:|
| **Documentation** | **DOI** | **Build Status** | **Test Coverage** |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://simonensemble.github.io/PorousMaterials.jl/dev) [![](https://img.shields.io/badge/docs-latest-blue.svg)](https://simonensemble.github.io/PorousMaterials.jl/stable) | [![DOI](https://zenodo.org/badge/102691401.svg)](https://zenodo.org/badge/latestdoi/102691401) | [![Build](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/ci_testing.yml/badge.svg)](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/ci_testing.yml) [![Docs](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/doc_deployment.yml/badge.svg)](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/doc_deployment.yml) [![Weekly](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/weekly.yml/badge.svg)](https://github.com/SimonEnsemble/PorousMaterials.jl/actions/workflows/weekly.yml) | [![codecov](https://codecov.io/gh/SimonEnsemble/PorousMaterials.jl/branch/master/graph/badge.svg?token=PWsgNnxfZI)](https://codecov.io/gh/SimonEnsemble/PorousMaterials.jl) [![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) |

A pure-[Julia](https://julialang.org/) package for classical molecular modeling of adsorption in porous crystals such as metal-organic frameworks (MOFs).
12 changes: 7 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
notes:
- all documentation files are in `docs/src`
- `make.jl` automatically pulls doc strings from code in `src`

to deploy locally:
- run `julia make.jl` from `docs` directory.
- open `build/index.html` in your browswer
- all documentation files are in `docs/src`
- `make.jl` automatically pulls doc strings from code in `src`

to deploy locally:

- run `julia make.jl` from `docs` directory.
- open `build/index.html` in your browswer
44 changes: 22 additions & 22 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
using Documenter
using PorousMaterials

makedocs(
root = joinpath(dirname(pathof(PorousMaterials)), "..", "docs"),
modules = [PorousMaterials],
sitename = "PorousMaterials.jl",
clean = true,
pages = [
"PorousMaterials" => "index.md",
"paths" => "paths.md",
"matter" => "matter.md",
"boxes" => "box.md",
"crystals" => "crystal.md",
"molecules" => "molecule.md",
"computing distances" => "distance.md",
"forcefields" => "force_field.md",
"equations of state" => "eos.md",
"Henry coefficients" => "henry.md",
"grand-canonical Monte Carlo simulations" => "gcmc.md",
"energy minimum" => "energy_min.md",
"grids" => "grid.md"
],
format = Documenter.HTML(assets = ["assets/flux.css"])
makedocs(;
root=joinpath(dirname(pathof(PorousMaterials)), "..", "docs"),
modules=[PorousMaterials],
sitename="PorousMaterials.jl",
clean=true,
pages=[
"PorousMaterials" => "index.md",
"paths" => "paths.md",
"matter" => "matter.md",
"boxes" => "box.md",
"crystals" => "crystal.md",
"molecules" => "molecule.md",
"computing distances" => "distance.md",
"forcefields" => "force_field.md",
"equations of state" => "eos.md",
"Henry coefficients" => "henry.md",
"grand-canonical Monte Carlo simulations" => "gcmc.md",
"energy minimum" => "energy_min.md",
"grids" => "grid.md"
],
format=Documenter.HTML(; assets=["assets/flux.css"])
)

deploydocs(repo="github.com/SimonEnsemble/PorousMaterials.jl.git")
deploydocs(; repo="github.com/SimonEnsemble/PorousMaterials.jl.git")
51 changes: 30 additions & 21 deletions docs/src/box.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```@meta
DocTestSetup = quote
using Xtals
using PorousMaterials
end
```

Expand All @@ -22,39 +22,46 @@ A `Box` is most conveniently constructed from its basic spatial data (`a` `b` `c
a = 26.13173 # Å
b = 26.13173
c = 6.722028
α = π/2 # radians
β = π/2
γ = 2*π/3
α = π / 2 # radians
β = π / 2
γ = 2 * π / 3
box = Box(a, b, c, α, β, γ)

# output

Bravais unit cell of a crystal.
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000000 deg.
Unit cell dimensions a = 26.131730 Å. b = 26.131730 Å, c = 6.722028 Å
Volume of unit cell: 3975.275878 ų
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000000 deg.
Unit cell dimensions a = 26.131730 Å. b = 26.131730 Å, c = 6.722028 Å
Volume of unit cell: 3975.275878 ų
```

A `Box` may also be defined by providing only the `Frac`tional-to-`Cart`esian conversion
matrix:

```jldoctest box
box = Box([26.1317 -13.0659 0; 0 22.6307 0; 0 0 6.72203])

# output

Bravais unit cell of a crystal.
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000113 deg.
Unit cell dimensions a = 26.131700 Å. b = 26.131711 Å, c = 6.722030 Å
Volume of unit cell: 3975.265115 ų
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000113 deg.
Unit cell dimensions a = 26.131700 Å. b = 26.131711 Å, c = 6.722030 Å
Volume of unit cell: 3975.265115 ų
```

To quickly get a simple unit-cubic `Box`, use the `unit_cube` function.

```jldoctest
unit_cube()

# output

Bravais unit cell of a crystal.
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 90.000000 deg.
Unit cell dimensions a = 1.000000 Å. b = 1.000000 Å, c = 1.000000 Å
Volume of unit cell: 1.000000 ų
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 90.000000 deg.
Unit cell dimensions a = 1.000000 Å. b = 1.000000 Å, c = 1.000000 Å
Volume of unit cell: 1.000000 ų
```


## transforming coordinates

Conversions are provided for switching between `Frac`tional and `Cart`esian `Coords`
Expand All @@ -63,38 +70,40 @@ using the `Box` (works for `Atoms` and `Charges`, too)
```jldoctest box
xtal = Crystal("SBMOF-1.cif")
Cart(xtal.atoms.coords, xtal.box)

# output

Cart([4.594867082350715 -0.952720283971488 … 0.8392490029633858 -1.5321086078257065; 1.4395486200000005 4.2228986200000005 … 1.4289162230000012 4.212266223; 5.89964228469024 5.359217037237699 … 17.537474811394276 16.239103154389543])
```


## replicating a box

For simulations in larger volumes than a single crystallograhic unit cell, the
`Box` may be replicated along each or any of the three crystallographic axes.

```jldoctest box
replicated_box = replicate(box, (2,2,2))
replicated_box = replicate(box, (2, 2, 2))

# output

Bravais unit cell of a crystal.
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000113 deg.
Unit cell dimensions a = 52.263400 Å. b = 52.263422 Å, c = 13.444060 Å
Volume of unit cell: 31802.120923 ų
Unit cell angles α = 90.000000 deg. β = 90.000000 deg. γ = 120.000113 deg.
Unit cell dimensions a = 52.263400 Å. b = 52.263422 Å, c = 13.444060 Å
Volume of unit cell: 31802.120923 ų
```


## exporting a box

For visualization of the unit cell boundaries, the `Box` may be written out to a
`.vtk` file for use in [Visit](https://wci.llnl.gov/simulation/computer-codes/visit/)

```jldoctest box
write_vtk(box, "box.vtk")

# output

```


# detailed docs

```@docs
Expand Down
Loading
Loading