Skip to content

Commit cfadc99

Browse files
authored
Merge pull request #1 from pyjanitor-devs/infra-docs
Infra + docs
2 parents cbab671 + 3a02037 commit cfadc99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1137
-513
lines changed

.github/workflows/docs.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Publish documentation
2+
name: documentation
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
17+
defaults:
18+
run:
19+
shell: bash -l {0}
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v2
24+
25+
# See: https://github.com/marketplace/actions/setup-miniconda
26+
- name: Setup miniconda
27+
uses: conda-incubator/setup-miniconda@v2
28+
with:
29+
auto-update-conda: true
30+
miniforge-variant: Mambaforge
31+
environment-file: environment.yml
32+
use-mamba: true
33+
34+
- name: Install pyjviz
35+
# use editable mode to avoid _pytest.pathlib.ImportPathMismatchError
36+
run: pip install -e .
37+
38+
- name: Build docs
39+
run: mkdocs build
40+
41+
- uses: actions/upload-artifact@v3
42+
with:
43+
name: website
44+
path: site/
45+
46+
- name: Docs preview
47+
if: ${{ github.event_name == 'pull_request' }}
48+
uses: nwtgck/[email protected]
49+
with:
50+
publish-dir: "./site"
51+
production-deploy: false
52+
github-token: ${{ secrets.GHPAGES_TOKEN }}
53+
deploy-message: "Deploy from GitHub Actions"
54+
enable-pull-request-comment: true
55+
enable-commit-comment: false
56+
overwrites-pull-request-comment: true
57+
alias: deploy-preview-${{ github.event.number }}
58+
env:
59+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
60+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
61+
timeout-minutes: 1
62+
63+
- name: Deploy website
64+
if: ${{ github.event_name == 'push' }}
65+
uses: peaceiris/actions-gh-pages@v3
66+
with:
67+
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
68+
personal_token: ${{ secrets.GHPAGES_TOKEN }}
69+
publish_dir: ./site/
70+
publish_branch: gh-pages
71+
# destination_dir: manuscript
72+
allow_empty_commit: false
73+
keep_files: false
74+
force_orphan: true
75+
enable_jekyll: false
76+
disable_nojekyll: false

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/psf/black
12+
rev: 23.1.0
13+
hooks:
14+
- id: black
15+
args: [--config, pyproject.toml]
16+
# - repo: https://github.com/pycqa/isort
17+
# rev: 5.11.2
18+
# hooks:
19+
# - id: isort
20+
# name: isort (python)
21+
- repo: https://github.com/econchick/interrogate
22+
rev: 1.5.0
23+
hooks:
24+
- id: interrogate
25+
args: [-c, pyproject.toml]
26+
- repo: https://github.com/terrencepreilly/darglint
27+
rev: v1.8.1
28+
hooks:
29+
- id: darglint
30+
args: [-v 2] # this config makes the error messages a bit less cryptic.
31+
- repo: https://github.com/PyCQA/flake8
32+
rev: 6.0.0
33+
hooks:
34+
- id: flake8
35+
args: [--exclude, nbconvert_config.py]

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"editor.rulers": [
3+
79
4+
]
5+
}

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The [`resulting SVG file`][res] of the run shows method chain calls along with i
5959

6060
## How it works?
6161

62-
`pyjviz` provides the way to create logfile which contains RDF graph of program behaviour. The visualization features of pyjviz provided in the package itself are based on RDF graph translation to graphviz dot lanuage. `pyjanitor` method chains are represented using certain RDF data schema (ref here to shacl defs). Using `pandas` extentions API `pyjanitor` (and `pandas`) method call arguments and returns are saved into RDF log.
62+
`pyjviz` provides the way to create logfile which contains RDF graph of program behaviour. The visualization features of pyjviz provided in the package itself are based on RDF graph translation to graphviz dot lanuage. `pyjanitor` method chains are represented using certain RDF data schema (ref here to shacl defs). Using `pandas` extentions API `pyjanitor` (and `pandas`) method call arguments and returns are saved into RDF log.
6363

6464
> **Note**
6565
> Visualisation of pyjviz RDF graph is not a main goal of provided package. Graphviz-based visualization avaiable in the package is rather reference implementation with quite limited (but still useful) capablities.
@@ -68,12 +68,10 @@ Python objects from `pyjviz` point of view have `object identity` and `object st
6868

6969
E.g. the simplest form of pandas dataframe 'carbon copy' can be obtained via using output of method head() then converted to HTML format - result of df.head().to_html() call. More comprehensive CC would be dataframe plot as generated by .plot method and saved as byte sequence. Note that 'carbon copy' is not necessary capture all details of original object state. If one need to have precise object state she would have to use CC class which guarantee that. CC like that would be based on .to_csv method in example above.
7070

71-
The way how particular call argument/return or other python objects are saved into RDF log is specified using CCGlance `carbon copy` class. For pandas dataframe it will save just shape of dataframe and its head() output serialized as HTML. If user wants to have other CC of the object it is always possible to use .cc() method ((ref here, rename .pin() to .cc())
71+
The way how particular call argument/return or other python objects are saved into RDF log is specified using CCGlance `carbon copy` class. For pandas dataframe it will save just shape of dataframe and its head() output serialized as HTML. If user wants to have other CC of the object it is always possible to use .cc() method ((ref here, rename .pin() to .cc())
7272

7373
--------
7474

7575
Obj is representation of pyjanitor object like pandas DataFrame. However input args are not objects rather object states. The state of object is represeneted by RDF class ObjState. The idea to separate object and object state is introduced to enable pyjviz to visualize situation when object has mutliple states used in method chain due to in-place operations. Such practice is discouraged by most of data packages but still may be used. In most cases where object has only state defined when object is created there is not difference betwen object and object state since there is one-to-one correspondence (isomorfism). So in some context below refernce to an object may imply object state instead.
7676

7777
pyjviz also introduce MethodCall RDF class. It represents pyjanitor method call. MethodCall object has incoming links from input objects and outgoing link an object representing retirn object.
78-
79-

docs/index.md

Whitespace-only changes.

doc/tmp/tmp2eu_4xcg.html renamed to docs/tmp/tmp2eu_4xcg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
<td>800.0</td>
3232
</tr>
3333
</tbody>
34-
</table>
34+
</table>

doc/tmp/tmpc3kafay7.html renamed to docs/tmp/tmpc3kafay7.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
<td>675.0</td>
2828
</tr>
2929
</tbody>
30-
</table>
30+
</table>

doc/tmp/tmpd_ffzcp4.html renamed to docs/tmp/tmpd_ffzcp4.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
<td>675.0</td>
3434
</tr>
3535
</tbody>
36-
</table>
36+
</table>

doc/tmp/tmpij_bu_q6.html renamed to docs/tmp/tmpij_bu_q6.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
<td>675.0</td>
2828
</tr>
2929
</tbody>
30-
</table>
30+
</table>

doc/tmp/tmpqji_p6l7.html renamed to docs/tmp/tmpqji_p6l7.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
<td>675.0</td>
2828
</tr>
2929
</tbody>
30-
</table>
30+
</table>

0 commit comments

Comments
 (0)