This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demo for displaying colored text in Jupyter Notebook.""" | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from IPython.display import HTML, display | |
def importance_to_color(importance): | |
cmap = plt.get_cmap("Greys") # YlOrRd, Greys | |
rgba = cmap(importance) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets the default shell for executing commands as /bin/bash and specifies command should be executed in a Bash shell. | |
SHELL := /bin/bash | |
GIT_ROOT ?= $(shell git rev-parse --show-toplevel) | |
# Optionally show commands being executed with V=1 | |
Q := $(if $(V),,@) | |
# Color codes for terminal output | |
COLOR_RESET=\033[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Usage example: | |
@timer_decorator | |
def sum_list(numbers): | |
return sum(numbers) | |
numbers = list(range(1, 1000000)) # Create a list of numbers from 1 to 999999 | |
result = sum_list(numbers) | |
print(f"Sum: {result}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; this is not a complete tox.ini file but just one env!!! | |
[testenv:coverage] | |
; it requires 'setup.py' or 'pyproject.toml' to have package installable. | |
deps = -rrequirements.txt | |
-rtox-reqs/coverage.txt | |
; usedevelop - fix problems with 0% coverage https://stackoverflow.com/a/69462954/3247880 | |
usedevelop=True | |
commands = | |
pytest --cov trend_classifier/ --cov-report html --cov-fail-under=70 tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Upload Python Package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests with Tox | |
on: | |
push: | |
branches: | |
- '*' # This will trigger the action on push to any branch | |
jobs: | |
test: | |
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Check links in README | |
# from: unixorn/git-extra-commands | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ '*' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.animation import FuncAnimation | |
from PIL import Image | |
def create_plot(i): | |
plt.clf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git-cliff ~ default configuration file | |
# https://git-cliff.org/docs/configuration | |
# | |
# Lines starting with "#" are comments. | |
# Configuration options are organized into tables and keys. | |
# See documentation for more information on available options. | |
[changelog] | |
# template for the changelog footer | |
header = """ |
NewerOlder