From 9ea994b65210a7ef1fda91e8c4f530b28d0c015e Mon Sep 17 00:00:00 2001 From: thomasms Date: Wed, 1 Nov 2023 18:20:38 +0100 Subject: [PATCH 1/2] Update gitignore and add an extra example --- .gitignore | 4 +++- examples/outputplotting/activity_vs_time.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 examples/outputplotting/activity_vs_time.py diff --git a/.gitignore b/.gitignore index c44fd27..e4b32d0 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,6 @@ htmlcov/ docs/_build docs/_static -docs/_templates \ No newline at end of file +docs/_templates + +venv/** diff --git a/examples/outputplotting/activity_vs_time.py b/examples/outputplotting/activity_vs_time.py new file mode 100644 index 0000000..d1dc243 --- /dev/null +++ b/examples/outputplotting/activity_vs_time.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import os +import pypact as pp + +nuclide_name = "Ca41" +filename = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "..", "..", "reference", "test127.out" +) + +def matcher(nuclide) -> bool: + return nuclide.name == nuclide_name + +with pp.Reader(filename) as output: + time_and_act = [ + (timestep.cooling_time, nuclide.activity) + for timestep in output + for nuclide in timestep.nuclides + if matcher(nuclide) + ] + print(time_and_act) From bbd373fea34e61510bb8f67434f4e3ddffefc4e3 Mon Sep 17 00:00:00 2001 From: thomasms Date: Wed, 1 Nov 2023 18:27:39 +0100 Subject: [PATCH 2/2] Update README --- .github/workflows/label.yml | 22 ---------------------- README.md | 3 ++- 2 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index bb7846b..0000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This workflow will triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# To use this workflow, you will need to set up a .github/labeler.yml -# file with configuration. For more information, see: -# https://github.com/actions/labeler - -name: "Pull Request Labeler" -on: -- pull_request_target - -jobs: - triage: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - diff --git a/README.md b/README.md index d1a4739..a8247cc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.org/fispact/pypact.svg?branch=master)](https://travis-ci.org/fispact/pypact) +![Build Status](https://github.com/fispact/pypact/actions/workflows/python-package.yml/badge.svg?branch=master) ![Python package](https://github.com/fispact/pypact/workflows/Python%20package/badge.svg?branch=master) [![Code Coverage](https://codecov.io/gh/fispact/pypact/branch/master/graph/badge.svg)](https://codecov.io/gh/fispact/pypact) @@ -7,7 +8,7 @@ [![PyPI](https://img.shields.io/pypi/format/pypact.svg)](https://pypi.python.org/pypi/pypact) [![License](https://img.shields.io/pypi/l/pypact.svg)](https://github.com/fispact/pypact/blob/master/LICENSE) -[![HitCount](http://hits.dwyl.io/fispact/pypact.svg)](http://hits.dwyl.io/fispact/pypact) +[![HitCount](https://hits.dwyl.com/fispact/pypact.svg?style=flat-square&show=unique)](http://hits.dwyl.com/fispact/pypact) [![GitHub issues](https://img.shields.io/github/issues/fispact/pypact)](https://github.com/fispact/pypact/issues) [![GitHub stars](https://img.shields.io/github/stars/fispact/pypact)](https://github.com/fispact/pypact/stargazers) [![GitHub forks](https://img.shields.io/github/forks/fispact/pypact)](https://github.com/fispact/pypact/network)