Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add simple docs and cleanup #73

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .codeclimate.yml

This file was deleted.

16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,17 @@ repos:
- id: upgrade-type-hints
args: [ '--futures=true' ]

- repo: https://github.com/psf/black
rev: 24.3.0
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: v0.2.2
hooks:
- id: black
- id: auto-walrus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.5"
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix, --unsafe-fixes, --show-fixes , --line-length=120]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

formats: [ ]

python:
install:
- requirements: requirements_dev.txt
- requirements: requirements.txt
- method: pip
path: .
30 changes: 0 additions & 30 deletions .scrutinizer.yml

This file was deleted.

38 changes: 38 additions & 0 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2022 zfit
*/

/*pydata-sphinx-theme provides some css variables for customizing the look of the theme.*/
/*See a list of supported css variables at*/
/*https://github.com/pydata/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/static/css/theme.css*/
html[data-theme="light"] {
/*--pst-color-primary: #080c80 !important;*/
--pst-color-primary: #D35827;
--pst-color-secondary: #27bcd3;
--pst-color-inline-code: #1d54e2;
/*--pst-color-target: yellow;*/


/*Here we use css directly because for these attributes there exist no css variables defined by pydata-sphinx-theme.*/
/*See https://github.com/pydata/pydata-sphinx-theme/issues/353 for possible changes in the future.*/

--pst-color-navbar-link: 255, 255, 255;
--pst-color-navbar-link-hover: 203, 86, 40;
--pst-color-navbar-link-active: 203, 86, 40;
}

html[data-theme="dark"] {
/*--pst-color-primary: #080c80 !important;*/
--pst-color-primary: #D35827;
--pst-color-secondary: #27bcd3;
--pst-color-inline-code: #1d54e2;
/*--pst-color-target: yellow;*/

--pst-color-navbar-link: 255, 255, 255;
--pst-color-navbar-link-hover: 203, 86, 40;
--pst-color-navbar-link-active: 203, 86, 40;
}

i.fa-github-square:before {
color: #ffffffff !important;
}
7 changes: 7 additions & 0 deletions docs/api/static/zfit_physics.pdf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pdf
===

.. automodule:: zfit_physics.pdf
:members:
:undoc-members:
:show-inheritance:
9 changes: 5 additions & 4 deletions docs/api/tools/change_headline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import annotations

import argparse
from pathlib import Path

parser = argparse.ArgumentParser(description="replace first two line")

Expand All @@ -7,15 +10,13 @@

n_files = 0
for rest_file in parsed_args.files:
with open(rest_file) as f:
with Path(rest_file).open() as f:
first_word = f.readline().strip().split()[0]
if "." not in first_word:
continue
replacement = first_word.split(".")[-1]
underline = f.readline()[0] * len(replacement)
lower_file = f.read()
with open(rest_file, "w") as f:
with Path(rest_file).open("w") as f:
f.write("\n".join((replacement, underline, lower_file)))
n_files += 1

print(f"finished successfully parsing {n_files} files")
Loading
Loading