Skip to content

Commit

Permalink
Merge pull request #28 from amepproject/release-1.0.x
Browse files Browse the repository at this point in the history
merge release 1.0.x into main
  • Loading branch information
hechtprojects authored May 22, 2024
2 parents 7491673 + 1a54f37 commit 3ac846e
Show file tree
Hide file tree
Showing 23 changed files with 186 additions and 80 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to **AMEP** will be documented in this file. **AMEP**
adheres to [semantic versioning](https://semver.org/).

## AMEP 1.0.2 (22 Mai 2024)

### Bug fixes:

* `fps` can now be set by the user in `amep.plot.animate_trajectory`
* bug in `amep.evaluate.MSD` related to incorrect data availability checks fixed

### Contributors:

* Lukas Hecht



## AMEP 1.0.1 (22 Apr 2024)

### Bug fixes:
Expand Down
35 changes: 35 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cff-version: 1.2.0
message: "If you use AMEP for a project that leads to a scientific publication, please acknowledge the use of AMEP within the body of your publication by citing L. Hecht, K.-R. Dormann, K. L. Spanheimer, M. Ebrahimi, M. Cordts, S. Mandal, A. K. Mukhopadhyay, and B. Liebchen, AMEP: The Active Matter Evaluation Package for Python, arXiv [Cond-Mat.Soft] (2024). Available at: http://arxiv.org/abs/2404.16533."
title: 'AMEP: The Active Matter Evaluation Package'
authors:
- name: "Lukas Hecht and the AMEP development team"
website: "https://amepproject.de/"
type: software
url: "https://amepproject.de/"
repository-code: "https://github.com/amepproject/amep"
preferred-citation:
type: article
authors:
- family-names: "Hecht"
given-names: "Lukas"
orcid: "https://orcid.org/0000-0002-9619-4991"
- family-names: "Dormann"
given-names: "Kay-Robert"
- family-names: "Spanheimer"
given-names: "Kai Luca"
- family-names: "Ebrahimi"
given-names: "Mahdieh"
- family-names: "Cordts"
given-names: "Malte"
- family-names: "Mandal"
given-names: "Suvendu"
- family-names: "Mukhopadhyay"
given-names: "Aritra K."
- family-names: "Liebchen"
given-names: "Benno"
orcid: "https://orcid.org/0000-0002-7647-6430"
title: "AMEP: The Active Matter Evaluation Package for Python"
year: 2024
doi: "10.48550/arXiv.2404.16533"
journal: "arXiv"
url: "https://arxiv.org/abs/2404.16533"
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[![Pepy Total Downlods](https://img.shields.io/pepy/dt/amep?label=pypi%7Cdownloads)](https://pypi.org/project/amep/)
[![Conda Downloads](https://img.shields.io/conda/d/conda-forge/amep)](https://anaconda.org/conda-forge/amep)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/amepproject/amep/test.yml?label=pipeline)](https://github.com/amepproject/amep/actions)
[![Static Badge](https://img.shields.io/badge/arXiv-2404.16533-brown)](https://doi.org/10.48550/arXiv.2404.16533)


<center><img src="https://raw.githubusercontent.com/amepproject/amep/main/doc/source/_static/images/amep-logo_v2.png" alt="amep logo" width="200" height="200"/></center>

Expand Down Expand Up @@ -144,6 +146,40 @@ Anaconda installation path.
to download FFmpeg and to get further information on how to install FFmpeg on your machine.


# Citation

If you use **AMEP** for a project that leads to a scientific publication, please acknowledge
the use of **AMEP** within the body of your publication for example by copying or adapting
the following formulation:

*Data analysis for this publication utilized the AMEP library [1].*

> [1] L. Hecht, K.-R. Dormann, K. L. Spanheimer, M. Ebrahimi, M. Cordts, S. Mandal,
> A. K. Mukhopadhyay, and B. Liebchen, AMEP: The Active Matter Evaluation Package for Python,
> *arXiv [Cond-Mat.Soft]* (2024). Available at: http://arxiv.org/abs/2404.16533.
The pre-print is freely available on [arXiv](https://arxiv.org/abs/2404.16533). To cite this reference,
you can use the following BibTeX entry:

```bibtex
@misc{hecht2024amep,
title = {AMEP: The Active Matter Evaluation Package for Python},
author = {Lukas Hecht and
Kay-Robert Dormann and
Kai Luca Spanheimer and
Mahdieh Ebrahimi and
Malte Cordts and
Suvendu Mandal and
Aritra K. Mukhopadhyay and
Benno Liebchen},
year = {2024},
eprint = {2404.16533},
archivePrefix = {arXiv},
primaryClass = {cond-mat.soft}
}
```


# Getting started

The following example briefly demonstrates the **AMEP** workflow. A typical
Expand Down
2 changes: 1 addition & 1 deletion amep/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"""
AMEP version number.
"""
__version__ = "1.0.1"
__version__ = "1.0.2"
60 changes: 33 additions & 27 deletions amep/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3802,35 +3802,41 @@ def __init__(

# get reference frame at time t0:
self.__frame0 = self.__traj[self.__nskip]

# check data availability
if self.__use_nojump and self.__traj[0].nojump_coords() is None:
raise ValueError(
'No nojump coordinates available. Call traj.nojump() '\
'to calculate the nojump coordinates.'
)
elif self.__pbc and self.__traj[0].unwrapped_coords() is None\
and self.__traj[0].nojump_coords() is None:
raise ValueError(
'Neither unwrapped nor nojump coordinates are available. '\
'Call traj.nojump() to calculate the nojump coordinates or '\
'do not apply periodic boundary conditions.'
)
else:
# get mode
if self.__use_nojump or\
(self.__pbc and self.__traj[0].unwrapped_coords() is None):
self.__mode = 'nojump'
elif self.__pbc and self.__traj[0].unwrapped_coords() is not None:
self.__mode = 'unwrapped'
if self.__pbc:
if self.__use_nojump:
try:
a = self.__traj[0].nojump_coords()
except:
raise ValueError(
'No nojump coordinates available. Call traj.nojump() '\
'to calculate the nojump coordinates.'
)
else:
self.__mode = 'normal'
# calculation
self.__frames, self.__avg, self.__indices = average_func(
self.__compute, self.__traj, skip=self.__skip,
nr=self.__nav, indices=True
)
self.__times = self.__traj.times[self.__indices]
try:
a = self.__traj[0].unwrapped_coords()
except:
raise ValueError(
'There are no unwrapped coordinates available. '\
'Please set use_nojump=True to use nojump coordinates '\
'instead or do not apply periodic boundary conditions.'
)
# get mode
if self.__pbc and self.__use_nojump:
self.__mode = 'nojump'
elif self.__pbc:
self.__mode = 'unwrapped'
else:
self.__mode = 'normal'

# calculation
self.__frames, self.__avg, self.__indices = average_func(
self.__compute, self.__traj, skip=self.__skip,
nr=self.__nav, indices=True
)
self.__times = self.__traj.times[self.__indices]


def __compute(self, frame):
r'''
Expand Down
5 changes: 4 additions & 1 deletion amep/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ def animate_trajectory(
formatter: Callable[[mpl.axes.Axes,], None] | None = None,
painter: object | None = None,
title: str = '', figsize: tuple[float, float] | None = None,
start: float = 0.0, stop: float = 1.0, nth: int = 1,
start: float = 0.0, stop: float = 1.0, nth: int = 1, fps: int = 10,
verbose: bool = False, **kwargs) -> None:
r'''Create a video from a trajectory.
Expand Down Expand Up @@ -1490,6 +1490,8 @@ def animate_trajectory(
larger than `start`. The default is 1.0.
nth : int, optional
Use each nth frame to make the animate. The default is 1.
fps: int, optional
The frames per second of the video. The default is 10.
verbose : bool, optional
If True, runtime information is printed. The default is False.
**kwargs
Expand Down Expand Up @@ -1668,6 +1670,7 @@ def animate(index: int) -> list:
with tqdm(total = len(indices)) as pbar:
anim.save(
outfile,
fps = fps,
progress_callback = lambda frameindex, nframes: pbar.update()
)
plt.close(fig)
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = 'AMEP'
copyright = '2023-2024, Lukas Hecht, Kay-Robert Dormann, Kai Luca Spanheimer'
author = 'Lukas Hecht, Kay-Robert Dormann, Kai Luca Spanheimer'
release = '1.0.1'
release = '1.0.2'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AMEP documentation

.. include:: ../../README.md
:parser: myst_parser.sphinx_
:start-line: 10
:start-line: 11

Table of Contents
=================
Expand Down
27 changes: 24 additions & 3 deletions doc/source/user_guide/howto_cite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@
How to cite **AMEP**
=====================

Please acknowledge the use of this software within the body of your publication for example by copying or adapting the following formulation:
If you use **AMEP** for a project that leads to a scientific publication, please acknowledge
the use of **AMEP** within the body of your publication for example by copying or adapting
the following formulation:

*Data analysis for this publication utilized the AMEP library [1].*

To cite **AMEP**, you can use the following BibTeX entry:
| [1] L. Hecht, K.-R. Dormann, K. L. Spanheimer, M. Ebrahimi, M. Cordts, S. Mandal,
| A. K. Mukhopadhyay, and B. Liebchen, AMEP: The Active Matter Evaluation Package for Python,
| *arXiv [Cond-Mat.Soft]* (2024). Available at: http://arxiv.org/abs/2404.16533.
The pre-print is freely available on `arXiv <https://arxiv.org/abs/2404.16533>`_. To cite this reference,
you can use the following BibTeX entry:

.. code-block:: bibtex
coming soon...
@misc{hecht2024amep,
title = {AMEP: The Active Matter Evaluation Package for Python},
author = {Lukas Hecht and
Kay-Robert Dormann and
Kai Luca Spanheimer and
Mahdieh Ebrahimi and
Malte Cordts and
Suvendu Mandal and
Aritra K. Mukhopadhyay and
Benno Liebchen},
year = {2024},
eprint = {2404.16533},
archivePrefix = {arXiv},
primaryClass = {cond-mat.soft}
}
36 changes: 18 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[project]
name = "amep"
version = "1.0.1"
version = "1.0.2"
license = {file="LICENSE"}
authors = [
{name = "Lukas Hecht", email = "[email protected]"},
{name = "Lukas Hecht", email = "[email protected]"},
]
description = "Active Matter Evaluation Package for data analysis of active matter simulations"
readme = "README.md"
Expand All @@ -17,26 +17,26 @@ keywords = [
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
]
dependencies = [
"h5py >= 3.7.0",
"matplotlib >= 3.6.2",
"numba >= 0.56.4",
"numpy >= 1.21.6",
"scipy >= 1.10.0",
"scikit-image >= 0.20.0",
"tqdm >= 4.65.0"
"h5py >= 3.7.0",
"matplotlib >= 3.6.2",
"numba >= 0.56.4",
"numpy >= 1.21.6",
"scipy >= 1.10.0",
"scikit-image >= 0.20.0",
"tqdm >= 4.65.0"
]

[project.urls]
Expand Down
2 changes: 0 additions & 2 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import os
import amep

Expand Down
4 changes: 4 additions & 0 deletions test/test_continuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ def test_cluster(self):
)
plot.field(axe[2], labels, *trajectory[-1].grid)
fig.savefig(PLOT_DIR/"Cluster_test.pdf")


if __name__ == '__main__':
unittest.main()
4 changes: 2 additions & 2 deletions test/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def setUpClass(cls):

def test_cluster_growth(self):
self.assertTrue((ClusterGrowth(self.field_trajs[1], scale=1.5, cutoff=0.8,
ftype="c", mode="mean").frames <=
ftype="c", mode="mean").frames.sum() <=
ClusterGrowth(self.field_trajs[1], scale=1.5, cutoff=0.8,
ftype="c",
mode="weighted mean").frames).all())
mode="weighted mean").frames.sum()))
self.assertTrue((ClusterGrowth(self.field_trajs[1],
ftype="c",
mode="largest").frames >= 0).all())
Expand Down
5 changes: 4 additions & 1 deletion test/test_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -50,3 +50,6 @@ def test_gaussian(self):
new_x = x_vec*0.3 + 2
axs.plot(new_x, gauss.generate(new_x), label="fit")
fig.savefig(PLOT_DIR/Path("test_gaussian.pdf"))

if __name__ == '__main__':
unittest.main()
2 changes: 0 additions & 2 deletions test/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
# IMPORT MODULES
# =============================================================================
import unittest
import sys
from zipfile import ZipFile
from requests import get
from pathlib import Path
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep

SERVER_URL: str = "https://kuno.fkp.physik.tu-darmstadt.de/d/a3d9887b8a5747e0a56e/files/?p=/"
Expand Down
4 changes: 1 addition & 3 deletions test/test_order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep

# =============================================================================
Expand Down
Loading

0 comments on commit 3ac846e

Please sign in to comment.