Skip to content

Commit

Permalink
Update GitHub Actions and Codecov versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cynddl committed Mar 23, 2024
1 parent 3490e52 commit 51e9603
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run pytest --mpl --cov=api.calculator --cov-report=xml
run: poetry run pytest --mpl --cov=sacredfug --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: cynddl/sacredfig
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
environment:
python: 3.11
python: 3.11.8
nodes:
tests:
dependencies:
Expand Down
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
# sacredfig
# sacredfig: standard styles for scientific figures in matplotlib

<div align="center">

[![pypi](https://img.shields.io/pypi/v/sacredfig.svg)](https://pypi.org/project/sacredfig/)
[![python](https://img.shields.io/pypi/pyversions/sacredfig.svg)](https://pypi.org/project/sacredfig/)
[![Build Status](https://github.com/cynddl/sacredfig/actions/workflows/tests.yml/badge.svg)](https://github.com/cynddl/sacredfig/actions)
[![codecov](https://codecov.io/gh/cynddl/sacredfig/branch/main/graphs/badge.svg?branch=main)](https://codecov.io/github/cynddl/sacredfig?branch=main)
[![Code Quality](https://img.shields.io/scrutinizer/g/cynddl/sacredfig.svg)](https://scrutinizer-ci.com/g/cynddl/sacredfig/?branch=main)

</div>

SacredFig is a Python library that provides opinionated styles for scientific figures in matplotlib.


## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install SacredFig.

```bash
pip install sacredfig
pip install sacredfig
```

## Usage

Simply import the package and use the sacredfig style:

```python
import matplotlib.pyplot as plt
import sacredfig

plt.style.use(sacredfig.style)

fig, ax = plt.subplots(figsize=(4, 4), dpi=150)
ax.grid(False, which='major', axis='x')

ax.plot([0, 1], [0, 1])
ax.set_box_aspect(1)
ax.set(xlabel="x", ylabel="y")
```

You can also use sacredfig temporarily:

```
with plt.style.context(sacredfig.style):
ax.plot(np.sin(np.linspace(0, 2 * np.pi)), 'r-o')
```

0 comments on commit 51e9603

Please sign in to comment.