[go: nahoru, domu]

Skip to content

Commit

Permalink
Release 3.0.2 (PR #199)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksebaz committed Feb 20, 2023
2 parents c2d2d90 + ab9009a commit 04800f9
Show file tree
Hide file tree
Showing 15 changed files with 1,557 additions and 1,210 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: tests

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8"]
env:
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install mdbenchmark
run: poetry install --extras docs
- name: Check reformat
run: poetry run make reformat-check
- name: Check style
run: poetry run make flake8
- name: Check sort
run: poetry run make isort-check
- name: Check reStructuredText
run: poetry run make rst-lint
- name: Unit-tests
run: poetry run pytest -v --cov=mdbenchmark --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
env_vars: PYTHON
fail_ci_if_error: true
- name: Build distribution
run: poetry build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dists.${{ matrix.python-version }}
path: dist/
- name: Make docs
run: |
cd docs
poetry run make build
test-build:

runs-on: ubuntu-latest
needs: test
strategy:
matrix:
python-version: ["3.7", "3.8"]

steps:
- name: Enable pip-caching
run: touch requirements.txt
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' #doesn't seem to work
- name: Update pip
run: pip install --upgrade pip
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dists.${{ matrix.python-version }}
path: dist
- name: Install mdbenchmark
run: pip install dist/*.tar.gz
- name: Check run
run: mdbenchmark

77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .travis/before_script.sh

This file was deleted.

19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
3.0.2 (2023-02-20)
==================

Features
--------

- Moved from travis to github-actions (PR 181) (`#181 <https://github.com/bio-phys/MDBenchmark/issues/181>`_)
- Add test to CI to verify distribution with pip. (PR 182) (`#182 <https://github.com/bio-phys/MDBenchmark/issues/182>`_)
- Make scaling projection show optimal scaling. (PR 193) (`#193 <https://github.com/bio-phys/MDBenchmark/issues/193>`_)


Bugfixes
--------

- Pin markupsafe to 2.0.1 to fix incompatibility with jinja2 ^2.10. (PR 184) (`#184 <https://github.com/bio-phys/MDBenchmark/issues/184>`_)
- Fix bug when plotting cpu-/gpu-data only with 'version3-categories'. (PR 192) (`#192 <https://github.com/bio-phys/MDBenchmark/issues/192>`_)
- Don't use deprecated kwarg 'type' in matplotlib.pyplot.savefig. (PR 195) (`#195 <https://github.com/bio-phys/MDBenchmark/issues/195>`_)


3.0.1 (2020-10-09)
==================

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Benchmark molecular dynamics simulations
.. image:: https://img.shields.io/pypi/l/mdbenchmark.svg
:target: https://pypi.python.org/pypi/mdbenchmark

.. image:: https://travis-ci.org/bio-phys/MDBenchmark.svg?branch=develop
:target: https://travis-ci.org/bio-phys/MDBenchmark
.. image:: https://github.com/bio-phys/MDBenchmark/actions/workflows/tests.yml/badge.svg?branch=develop
:target: https://github.com/bio-phys/MDBenchmark/actions/workflows/tests.yml

.. image:: https://readthedocs.org/projects/mdbenchmark/badge/?version=latest&style=flat
:target: https://mdbenchmark.readthedocs.io/en/latest/
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
# The short X.Y version.
version = "3.0"
# The full version, including alpha/beta/rc tags.
release = "3.0.1"
release = "3.0.2"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ MDBenchmark: Benchmark molecular dynamics simulations
.. image:: https://img.shields.io/pypi/l/mdbenchmark.svg
:target: https://pypi.python.org/pypi/mdbenchmark

.. image:: https://travis-ci.org/bio-phys/MDBenchmark.svg?branch=develop
:target: https://travis-ci.org/bio-phys/MDBenchmark
.. image:: https://github.com/bio-phys/MDBenchmark/actions/workflows/tests.yml/badge.svg?branch=develop
:target: https://github.com/bio-phys/MDBenchmark/actions/workflows/tests.yml

.. image:: https://codecov.io/gh/bio-phys/MDBenchmark/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/bio-phys/MDBenchmark
Expand Down
8 changes: 4 additions & 4 deletions docs/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ To change the x-axis label from number of nodes to number of cores you can run::

mdbenchmark plot --plot-cores

Hiding the linear fit
---------------------
Hiding the optimal scaling
--------------------------

To create a plot without any linear fit, use the ``--no-fit`` option::
To create a plot without any optimal scaling graph, use the ``--no-fit`` option::

mdbenchmark plot --no-fit

Expand Down Expand Up @@ -118,4 +118,4 @@ By default a small watermark will be placed in the top left corner of every plot

You are free to use your plots with and without the watermark, whereever you like, but we kindly ask you to cite our `latest DOI`_ from Zenodo. In this way, more people will notice MDBenchmark and start optimizing their use of high performance computing resources.

.. _latest DOI: https://zenodo.org/record/1156082
.. _latest DOI: https://zenodo.org/record/1156082
2 changes: 1 addition & 1 deletion mdbenchmark/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
#
# You should have received a copy of the GNU General Public License
# along with MDBenchmark. If not, see <http://www.gnu.org/licenses/>
VERSION = "3.0.1"
VERSION = "3.0.2"
2 changes: 1 addition & 1 deletion mdbenchmark/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def generate(
)
@click.option(
"--fit/--no-fit",
help="Fit a line through the first two data points, indicating linear scaling.",
help="Fit a line through the first data point, indicating optimal scaling.",
show_default=True,
default=True,
)
Expand Down
31 changes: 10 additions & 21 deletions mdbenchmark/cli/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from matplotlib.figure import Figure

from mdbenchmark import console
from mdbenchmark.math import calc_slope_intercept, lin_func
from mdbenchmark.mdengines import SUPPORTED_ENGINES
from mdbenchmark.utils import generate_output_name
from mdbenchmark.versions import VersionFactory
Expand Down Expand Up @@ -60,19 +59,11 @@ def get_xsteps(size, min_x, plot_cores, xtick_step):


def plot_projection(df, selection, color, performance_column, ax=None):
# Grab x and y values
xs = df[selection].iloc[0:2].values.tolist()
ys = df[performance_column].iloc[0:2].values.tolist()

# Calculate slope and intercept
p1, p2 = list(zip(xs, ys))
slope, intercept = calc_slope_intercept(p1, p2)

# Plot the projection
xstep = np.diff(xs)
xmax = (df[selection].iloc[-1] + xstep).tolist()
xs = np.array([0] + xs + xmax)
ax.plot(xs, lin_func(xs, slope, intercept), ls="--", color=color, alpha=0.5)
xs = df[selection].values
ys = df[performance_column].values
xs = np.concatenate((np.array([0]), xs))
yp = ys[0] * xs / xs[1]
ax.plot(xs, yp, ls="--", color=color, alpha=0.5)

return ax

Expand Down Expand Up @@ -150,13 +141,15 @@ def plot_over_group(df, plot_cores, fit, performance_column, ax=None):


def filter_dataframe_for_plotting(df, host_name, module_name, gpu, cpu):
gpu_col = "use_gpu" if "use_gpu" in df.columns else "gpu"

if gpu and cpu:
console.info("Plotting GPU and CPU data.")
elif gpu and not cpu:
df = df[df.gpu]
df = df[df[gpu_col]]
console.info("Plotting GPU data only.")
elif cpu and not gpu:
df = df[~df.gpu]
df = df[~df[gpu_col]]
console.info("Plotting CPU data only.")
elif not cpu and not gpu:
console.error("CPU and GPU not set. Nothing to plot. Exiting.")
Expand Down Expand Up @@ -288,10 +281,6 @@ def do_plot(
output_name = "{}.{}".format(output_name, output_format)

fig.savefig(
output_name,
type=output_format,
bbox_extra_artists=(legend,),
bbox_inches="tight",
dpi=dpi,
output_name, bbox_extra_artists=(legend,), bbox_inches="tight", dpi=dpi,
)
console.info("The plot was saved as '{}'.", output_name)
33 changes: 0 additions & 33 deletions mdbenchmark/math.py

This file was deleted.

Loading

0 comments on commit 04800f9

Please sign in to comment.