Skip to content

Commit

Permalink
black-pack
Browse files Browse the repository at this point in the history
  • Loading branch information
relleums committed Sep 18, 2023
1 parent 8d3a141 commit abcad20
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/binning-utils-sebastian-achim-mueller/
url: https://pypi.org/project/binning_utils_sebastian-achim-mueller
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -30,4 +30,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_BINNING_UTILS }}
password: ${{ secrets.PYPI_API }}
77 changes: 69 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ __pycache__/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand All @@ -21,9 +20,11 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -38,13 +39,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -53,6 +58,8 @@ coverage.xml
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -65,27 +72,61 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version
# IPython
profile_default/
ipython_config.py

# celery beat schedule file
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# dotenv
# Environments
.env

# virtualenv
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
Expand All @@ -97,3 +138,23 @@ ENV/
# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Create binning with power-space which is aligned to decades.
.. |BlackStyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:target: https://github.com/psf/black

.. |TestStatus| image:: https://github.com/cherenkov-plenoscope/binning_utils/actions/workflows/test.yml/badge.svg?branch=main&event=push
:target: https://github.com/cherenkov-plenoscope/binning_utils/actions/workflows/test.yml
.. |TestStatus| image:: https://github.com/cherenkov-plenoscope/binning_utils/actions/workflows/test.yml/badge.svg?branch=main
:target: https://github.com/cherenkov-plenoscope/binning_utils/actions/workflows/test.yml

.. |PyPiStatus| image:: https://img.shields.io/pypi/v/binning-utils-sebastian-achim-mueller
:target: https://pypi.org/project/binning-utils-sebastian-achim-mueller/
.. |PyPiStatus| image:: https://img.shields.io/pypi/v/binning_utils_sebastian-achim-mueller
:target: https://pypi.org/project/binning_utils_sebastian-achim-mueller
6 changes: 4 additions & 2 deletions binning_utils/power10.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ def find_upper_decade_and_bin(x, num_bins_per_decade=5):
"""
decade = int(np.log10(x))
bin_factor = lower_bin_edge(
decade=0, bin=1, num_bins_per_decade=num_bins_per_decade,
decade=0,
bin=1,
num_bins_per_decade=num_bins_per_decade,
)
xn = float(x / (10 ** decade))
xn = float(x / (10**decade))
b = 0
while b < num_bins_per_decade:
xn = xn / bin_factor
Expand Down
7 changes: 5 additions & 2 deletions binning_utils/tests/test_power10.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ def test_power10_space():

actual_power_ratios = space[1:] / space[0:-1]
desired_power_ratio = binu.power10.lower_bin_edge(
decade=0, bin=1, num_bins_per_decade=5,
decade=0,
bin=1,
num_bins_per_decade=5,
)

np.testing.assert_allclose(
actual=actual_power_ratios, desired=desired_power_ratio,
actual=actual_power_ratios,
desired=desired_power_ratio,
)


Expand Down
2 changes: 1 addition & 1 deletion binning_utils/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.9"
__version__ = "0.0.10"
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os


with open("README.rst", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("README.rst", "r", encoding="utf-8") as f:
long_description = f.read()


with open(os.path.join("binning_utils", "version.py")) as f:
Expand All @@ -20,12 +20,11 @@
long_description=long_description,
long_description_content_type="text/x-rst",
url="https://github.com/cherenkov-plenoscope/binning_utils",
project_urls={
"Bug Tracker": "https://github.com/cherenkov-plenoscope/binning_utils/issues",
},
author="Sebastian Achim Mueller",
author_email="sebastian-achim.mueller@mpi-hd.mpg.de",
packages=["binning_utils",],
packages=[
"binning_utils",
],
package_data={"binning_utils": []},
install_requires=[],
classifiers=[
Expand Down

0 comments on commit abcad20

Please sign in to comment.