Skip to content

Commit

Permalink
minor ci improvements and bug-fixes to previous pr (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski authored Sep 1, 2022
1 parent 1f11a01 commit fcb8da5
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ on:
- '*.rst'
- '*.md'
push:
branches:
- master
- develop
- beta/*
branch:
- 'main'
paths-ignore:
- 'doc/**'
- 'docs/**'
- '*.rst'
- '*.md'

Expand All @@ -28,6 +26,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 3
- uses: actions/setup-python@v2
with:
python-version: 3.9
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 3
fetch-depth: 0 # needed for setuptools_scm
- uses: actions/setup-python@v2
with:
python-version: "3.9"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'docs/**'
- '*.rst'
- '*.md'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
Expand All @@ -30,6 +31,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 3
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
fetch-depth: 0 # needed by setuptools_scm

- uses: pypa/cibuildwheel@v2.3.1
env:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ A Pythonic wrapper for the HepMC3 C++ library.
.. image:: https://badge.fury.io/py/pyhepmc.svg
:target: https://pypi.org/project/pyhepmc

.. image:: https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg
:target: https://coveralls.io/github/scikit-hep/pyhepmc
.. image:: https://coveralls.io/repos/github/scikit-hep/pyhepmc/badge.svg?branch=main
:target: https://coveralls.io/github/scikit-hep/pyhepmc?branch=main

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7013498.svg
:target: https://doi.org/10.5281/zenodo.7013498
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = pyhepmc
author = Hans Dembinski
author_email = hans.dembinski@gmail.com
description = Pythonic interface to the HepMC3 C++ library.
long_description = file: README.md
long_description_content_type = text/markdown
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/scikit-hep/pyhepmc
project_urls =
Documentation = https://github.com/scikit-hep/pyhepmc
Documentation = https://scikit-hep.org/pyhepmc/
license_files = LICENSE, extern/pybind11/LICENSE, extern/HepMC3/LICENSE
classifiers =
Programming Language :: Python :: 3
Expand Down
4 changes: 3 additions & 1 deletion src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ inline std::ostream& repr(std::ostream& os, const HepMC3::GenEvent& x) {

inline int gencrosssection_validate_index(GenCrossSection& cs, py::object obj) {
auto idx = py::cast<int>(obj);
const auto size = cs.event() ? (std::max)(cs.event()->weights().size(), 1ul) : 1ul;
const auto size =
cs.event() ? (std::max)(cs.event()->weights().size(), static_cast<std::size_t>(1))
: 1u;
if (idx < 0) idx += size;
if (idx < 0 || idx >= size) throw py::index_error();
return idx;
Expand Down

0 comments on commit fcb8da5

Please sign in to comment.