Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8c28301
preliminary commit, copying commits from h5mdreader PR
edisj Jul 24, 2020
7944b0d
removed pyh5md code
edisj Jul 24, 2020
5be9916
pulled from upstream and fixing merge conflict
edisj Jul 28, 2020
6a03f37
Merge branch 'issue-2866-h5mdwriter' of https://github.com/edisj/mdan…
edisj Jul 28, 2020
ed054c9
added pyh5md LICENSE info, other small adjustments
edisj Jul 28, 2020
22324f3
adding cobrotoxin file
edisj Jul 28, 2020
877d0fd
updated cobrotoxin
edisj Aug 5, 2020
9ebc1b2
Towards #2468 (RDKit interoperability GSOC project)
Aug 22, 2020
ca2cbe4
Merge PR #2916 (originally PR #2775): RDKitConverter (Issue #2468)
IAlibay Aug 23, 2020
45e56e8
Faster name selections (#2755)
richardjgowers Aug 25, 2020
84d2275
updated function signatures
lilyminium Aug 27, 2020
3e6b38c
Remove as_Universe (Issue #2920) (#2922)
IAlibay Aug 27, 2020
a8227f0
Merge pull request #2923 from lilyminium/fix-2921
orbeckst Aug 28, 2020
b2b7bcb
Add SMARTS selection (#2883)
Aug 29, 2020
2c5e385
Refactor Transformations from closure into class (#2859)
yuxuanzhuang Sep 8, 2020
3148207
Add test files (#2940)
lilyminium Sep 9, 2020
f0899e4
oops
lilyminium Sep 6, 2020
ddb354e
add docs for analysis.align.AverageStructure
orbeckst Sep 15, 2020
c4478d3
RDKitConverter bugfix on HIP residue (#2941)
Sep 18, 2020
56c5ea9
ensure that unistd.h is included for spe.c with recent clang
orbeckst Sep 18, 2020
a321fa7
Merge pull request #2949 from MDAnalysis/issue-2934-unistd-apple
orbeckst Sep 23, 2020
3df4581
Remove helanal (#2929)
lilyminium Sep 23, 2020
2687c40
comment out parmed intersphinx
lilyminium Sep 28, 2020
9b88b83
Removes element guessing from ParmedParser (Issue #2933) (#2959)
IAlibay Sep 30, 2020
108f1c2
Fix readme tutorial link (#2961)
IAlibay Sep 30, 2020
60d3d18
Write more redirect stubs (#2955)
lilyminium Oct 1, 2020
11f343a
fix 2.0.0-dev0 and sort versions so dev is 2.0.0-dev not 1.0.1-dev
lilyminium Oct 1, 2020
08491cc
added error messages and progress printing
lilyminium Oct 1, 2020
be9380b
revert version
lilyminium Oct 2, 2020
5c70cf0
MAINT: fix invalid escape seqs
tylerjereddy Aug 6, 2020
3337942
MAINT: PR 2885 revisions
tylerjereddy Aug 9, 2020
d83c782
MAINT: cleaned up escape strings and fixed reST
orbeckst Aug 10, 2020
542daa9
Merge pull request #2885 from tylerjereddy/treddy_invalid_escape_fix
orbeckst Oct 2, 2020
ecaec3f
Have copies of docs at stable/ and dev/ (#2968)
lilyminium Oct 6, 2020
5e8caf0
Change CHARMM selection syntax page (#2972)
IAlibay Oct 6, 2020
a9543ba
restores parmed intersphinx (#2978, Issue #2951)
lilyminium Oct 10, 2020
64a7c05
Use a fixture for npz files in test_bat (#2981)
jbarnoud Oct 14, 2020
2ee4e9d
Have CI use mamba (#2983)
jbarnoud Oct 15, 2020
26880f0
Update indexing in Charges and Masses get_residues (#2991)
jbarnoud Oct 16, 2020
beb5232
Fixed AtomGroup.center's behavior when using compounds in conjugation…
mnmelo Oct 18, 2020
daee516
TST, CI: add ARM64 Graviton 2 to CI (#2956)
tylerjereddy Oct 19, 2020
75efc31
MAINT: ARM64 CI cleanup (#2997)
tylerjereddy Oct 19, 2020
6b0cbd6
Re-write URLs in sitemap.xml (#2994)
lilyminium Oct 20, 2020
0aace31
Add a reindex argument to the PDBWritter (#2886)
jbarnoud Oct 21, 2020
2912678
H5MDWriter working version - does not write observables group yet
Mar 16, 2021
29e7ef1
preliminary commit, copying commits from h5mdreader PR
edisj Jul 24, 2020
23c7e7a
removed pyh5md code
edisj Jul 24, 2020
dcf09c9
added pyh5md LICENSE info, other small adjustments
edisj Jul 28, 2020
9727bdd
H5MDWriter working version - does not write observables group yet
Mar 16, 2021
3a92a22
updated working h5mdwriter
Mar 16, 2021
93b52d6
fixing azure-piplines conflict
Mar 16, 2021
a6e793b
deleted duplicated code
Mar 16, 2021
b55bffe
shape tuple
Mar 17, 2021
0097591
need to fix condition if file doesn't contain vel or forces
Mar 17, 2021
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
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ env:
- INSTALL_HOLE="true"
- CYTHON_TRACE_NOGIL=1
- MPLBACKEND=agg
- MAMBA=true

matrix:
# Run a coverage test for most versions
Expand Down Expand Up @@ -95,6 +96,29 @@ matrix:
INSTALL_HOLE="false"
CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis"

- os: linux
language: python
arch: arm64-graviton2
python:
- "3.7"
dist: focal
virt: vm
group: edge
before_install:
- python -m pip install cython numpy scipy
- python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm
install:
- cd package
- python setup.py install
- cd ../testsuite
- python setup.py install
- cd ..
script:
- cd testsuite
- python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis
after_success:
- echo "Override this stage for ARM64"

allow_failures:
- env: NUMPY_VERSION=dev EVENT_TYPE="cron"

Expand Down
42 changes: 42 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,45 @@ are distributed under the same license as the 'Atom' logo.

==========================================================================

pyh5md is released under the following 'BSD 3-clause' licence:

-----------------------------------------------------------------------------
pyh5md

Author of Original Implementation:
Pierre de Buyl
Institute for Theoretical Physics
KU Leuven University
Celestijnenlaan 200d - box 2415
3001 Leuven

pierre.debuyl@kuleuven.be

Copyright (c) 2012-2017, Pierre de Buyl and contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

==========================================================================
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ of MDAnalysis.

**Developers** may also want to refer to the `MDAnalysis API docs`_.

A growing number of **tutorials_** are available that explain how to
A growing number of `tutorials`_ are available that explain how to
conduct RMSD calculations, structural alignment, distance and contact
analysis, and many more.

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
pytest-xdist
scikit-learn
scipy
h5py
h5py==2.10.0
tqdm
displayName: 'Install dependencies'
# TODO: recent rdkit is not on PyPI
Expand Down
17 changes: 13 additions & 4 deletions maintainer/deploy_docs_via_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,26 @@ git remote add upstream "https://${GH_TOKEN}@${GH_REPOSITORY}"
git fetch --depth 50 upstream ${GH_DOC_BRANCH} gh-pages
git reset upstream/gh-pages

# for dev, latest, home redirects
mkdir dev latest
# === REDIRECTS AND COPIES ====
# home (index.html) redirects to stable/
# latest (latest/index.html) redirects to most recent release
# dev/ is a copy of the dev docs with the highest number (so 2.0.0-dev instead of 1.0.1-dev)
# stable/ is a copy of the release docs with the highest number
mkdir latest
export URL="https://docs.mdanalysis.org"
python ${MAINTAIN_DIR}/update_json_stubs_sitemap.py
touch .
touch .nojekyll

git add -A ${VERSION}/
git add .nojekyll versions.json
git add index.html dev latest
git add *.xml
git add index.html latest

for dirname in dev stable documentation_pages ; do
if [ -d $dirname ]; then git add $dirname; fi
done

git add *.xml *.html

# check for anything to commit
# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes
Expand Down
156 changes: 123 additions & 33 deletions maintainer/update_json_stubs_sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import os
import shutil
import xml.etree.ElementTree as ET
import errno
import glob
import textwrap
import shutil

try:
from urllib.request import Request, urlopen
Expand All @@ -22,6 +26,16 @@
URL = os.environ['URL']
VERSION = os.environ['VERSION']

if "http" not in URL:
raise ValueError("URL should have the transfer protocol (HTTP/S). "
f"Given: $URL={URL}")

try:
int(VERSION[0])
except ValueError:
raise ValueError("$VERSION should start with a number. "
f"Given: $VERSION={VERSION}") from None


def get_web_file(filename, callback, default):
url = os.path.join(URL, filename)
Expand All @@ -40,14 +54,30 @@ def get_web_file(filename, callback, default):
return callback(data)


def write_redirect(file, version='', outfile=None):
if outfile is None:
outfile = file
url = os.path.join(URL, version, file)
REDIRECT = textwrap.dedent(f"""
<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to {url}</title>
<meta http-equiv="refresh" content="0; URL={url}">
<link rel="canonical" href="{url}">
""")
with open(outfile, 'w') as f:
f.write(REDIRECT)
print(f"Wrote redirect from {url} to {outfile}")


# ========= WRITE JSON =========
# Update $root/versions.json with links to the right version
versions = get_web_file('versions.json', json.loads, [])
existing = [item['version'] for item in versions]
already_exists = VERSION in existing
latest = 'dev' not in VERSION

if not already_exists:
latest = 'dev' not in VERSION
if latest:
for ver in versions:
ver['latest'] = False
Expand All @@ -59,52 +89,112 @@ def get_web_file(filename, callback, default):
'latest': latest
})

with open("versions.json", 'w') as f:
json.dump(versions, f, indent=2)

# ========= WRITE HTML STUBS =========
# Add HTML files to redirect:
# index.html -> latest release
# latest/index.html -> latest release
# dev/index.html -> dev docs

REDIRECT = """
<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to {url}</title>
<meta http-equiv="refresh" content="0; URL={url}">
<link rel="canonical" href="{url}">
"""

for ver in versions[::-1]:
if ver['latest']:
latest_url = ver['url']
latest_version = ver['version']
break
else:
try:
latest_url = versions[-1]['url']
latest_version = versions[-1]['version']
except IndexError:
latest_url = None
latest_version = None

for ver in versions[::-1]:
if 'dev' in ver['version']:
dev_url = ver['url']
if '-dev' in ver['version']:
dev_version = ver['version']
break
else:
try:
dev_url = versions[-1]['url']
dev_version = versions[-1]['version']
except IndexError:
dev_url = None
dev_version = None

if latest_url:
with open('index.html', 'w') as f:
f.write(REDIRECT.format(url=latest_url))
versions.sort(key=lambda x: x["version"])

with open('latest/index.html', 'w') as f:
f.write(REDIRECT.format(url=latest_url))
# ========= WRITE HTML STUBS AND COPY DOCS =========
# Add HTML files to redirect:
# index.html -> stable/ docs
# latest/index.html -> latest release (not dev docs)
# stable/ : a copy of the release docs with the highest number (2.0.0 instead of 1.0.0)
# dev/ : a copy of the develop docs with the highest number (2.0.0-dev instead of 1.0.1-dev)
# sitemap.xml files are updated by replacing URL strings


def redirect_sitemap(old_version, new_version):
"""Replace paths in copied sitemap.xml with new directory path

Sitemaps can only contain URLs 'within' that directory structure.
For more, see https://www.sitemaps.org/faq.html#faq_sitemap_location
"""
file = f"{new_version}/sitemap.xml"
old = f"{URL}/{old_version}/"
new = f"{URL}/{new_version}/"
try:
with open(file, "r") as f:
contents = f.read()
except OSError:
raise ValueError(f"{file} not found")
redirected = contents.replace(old, new)
with open(file, "w") as f:
f.write(redirected)
print(f"Redirected URLs in {file} from {old} to {new}")


def add_or_update_version(version):
"""Add or update the version path to versions.json"""
for ver in versions:
if ver["version"] == version:
ver["url"] = os.path.join(URL, version)
break
else:
versions.append({
"version": version,
"display": version,
"url": os.path.join(URL, version),
"latest": False
})


def copy_version(old_version, new_version):
"""Copy docs from one directory to another with all bells and whistles"""
shutil.copytree(old_version, new_version)
print(f"Copied {old_version} to {new_version}")
redirect_sitemap(old_version, new_version)
add_or_update_version(new_version)


# Copy stable/ docs and write redirects from root level docs
if latest:
copy_version(VERSION, "stable")
html_files = glob.glob(f'stable/**/*.html', recursive=True)
for file in html_files:
# below should be true because we only globbed stable/* paths
assert file.startswith("stable/")
outfile = file[7:] # strip "stable/"
dirname = os.path.dirname(outfile)
if dirname and not os.path.exists(dirname):
try:
os.makedirs(dirname)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise

write_redirect(file, '', outfile)

# Separate just in case we update versions.json or muck around manually
# with docs
if latest_version:
write_redirect('index.html', "stable")
write_redirect('index.html', latest_version, 'latest/index.html')

# Copy dev/ docs
if dev_version and dev_version == VERSION:
copy_version(VERSION, "dev")

# update versions.json online
with open("versions.json", 'w') as f:
json.dump(versions, f, indent=2)

if dev_url:
with open('dev/index.html', 'w') as f:
f.write(REDIRECT.format(url=dev_url))

# ========= WRITE SUPER SITEMAP.XML =========
# make one big sitemap.xml
Expand Down
Loading