Skip to content

Commit

Permalink
chore: Update pre-commit (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
akihironitta authored Aug 13, 2024
1 parent e278402 commit 4a9d91b
Show file tree
Hide file tree
Showing 14 changed files with 211 additions and 175 deletions.
25 changes: 13 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ If you are interested in contributing to PyTorch Frame, your contributions will

1. You want to implement a new feature:
- In general, we accept any features as long as they fit the scope of this package. If you are unsure about this or need help on the design/implementation of your feature, post about it in an issue.
2. You want to fix a bug:
1. You want to fix a bug:
- Feel free to send a Pull Request (PR) any time you encounter a bug. Please provide a clear and concise description of what the bug was. If you are unsure about if this is a bug at all or how to fix, post about it in an issue.

Once you finish implementing a feature or bug-fix, please send a PR to https://github.com/pyg-team/pytorch-frame.

Your PR will be merged after one or more rounds of reviews by the [pyg-team](https://github.com/pyg-team).


## Developing PyTorch Frame

To develop PyTorch Frame on your machine, here are some tips:
Expand All @@ -23,26 +22,28 @@ To develop PyTorch Frame on your machine, here are some tips:
print(torch.__version__)
```

2. Uninstall all existing PyTorch Frame installations.
1. Uninstall all existing PyTorch Frame installations.
It is advised to run this command repeatedly to confirm that installations across all locations are properly removed.

```bash
pip uninstall pytorch_frame
```

3. Fork and clone the PyTorch Frame repository:
1. Fork and clone the PyTorch Frame repository:

```bash
git clone https://github.com/<your_username>/pytorch-frame.git
cd pytorch-frame

5. If you already cloned PyTorch Frame from source, update it:
```

1. If you already cloned PyTorch Frame from source, update it:

```bash
git pull
```

6. Install PyTorch Frame in editable mode:
1. Install PyTorch Frame in editable mode:

```bash
pip install -e ".[dev,full]"
Expand All @@ -51,13 +52,13 @@ To develop PyTorch Frame on your machine, here are some tips:
This mode will symlink the Python files from the current local source tree into the Python install.
Hence, if you modify a Python file, you do not need to re-install PyTorch Frame again.

7. Ensure that you have a working PyTorch Frame installation by running the entire test suite with
1. Ensure that you have a working PyTorch Frame installation by running the entire test suite with

```bash
pytest
```

8. Install pre-commit hooks:
1. Install pre-commit hooks:

```bash
pre-commit install
Expand Down Expand Up @@ -91,7 +92,7 @@ Everytime you send a Pull Request, your commit will be built and checked against

If you do not want to format your code manually, we recommend to use [`yapf`](https://github.com/google/yapf).

2. Ensure that the entire test suite passes and that code coverage roughly stays the same.
1. Ensure that the entire test suite passes and that code coverage roughly stays the same.
Please feel encouraged to provide a test with your submitted code.
To test, either run

Expand All @@ -101,19 +102,19 @@ Everytime you send a Pull Request, your commit will be built and checked against

(which runs a set of additional but time-consuming tests) dependening on your needs.

3. Add your feature/bugfix to the [`CHANGELOG.md`](https://github.com/pyg-team/pyotrch-frame/blob/master/CHANGELOG.md?plain=1).
1. Add your feature/bugfix to the [`CHANGELOG.md`](https://github.com/pyg-team/pyotrch-frame/blob/master/CHANGELOG.md?plain=1).
If multiple PRs move towards integrating a single feature, it is advised to group them together into one bullet point.

## Building Documentation

To build the documentation:

1. [Build and install](#developing-pytorch-frame) PyTorch Frame from source.
2. Install [Sphinx](https://www.sphinx-doc.org/en/master/) theme via
1. Install [Sphinx](https://www.sphinx-doc.org/en/master/) theme via
```bash
pip install git+https://github.com/pyg-team/pyg_sphinx_theme.git
```
3. Generate the documentation via:
1. Generate the documentation via:
```bash
cd docs
make html
Expand Down
32 changes: 31 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ repos:
name: Lint yaml
args: [-d, '{extends: default, rules: {line-length: disable, document-start: disable, truthy: {level: error}, braces: {max-spaces-inside: 1}}}']

- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
name: Upgrade Python syntax
args: [--py38-plus]

- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
name: Remove unused imports and variables
args: [
--remove-all-unused-imports,
--remove-unused-variables,
--remove-duplicate-keys,
--ignore-init-module-imports,
--in-place,
]

- repo: https://github.com/google/yapf
rev: v0.40.2
hooks:
Expand Down Expand Up @@ -65,5 +85,15 @@ repos:
hooks:
- id: mypy
name: Check types
additional_dependencies: [torch==2.2.0]
additional_dependencies: [torch==2.4.0]
exclude: "^test/|^examples/|^benchmark/"

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
name: Format Markdown
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter
- mdformat_footnote
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).


## [Unreleased]
## \[Unreleased\]

### Added

Expand All @@ -21,7 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed CUDA synchronizations from `nn.LinearEmbeddingEncoder` ([#432](https://github.com/pyg-team/pytorch-frame/pull/432))
- Removed CUDA synchronizations from N/A imputation logic in `nn.StypeEncoder` ([#433](https://github.com/pyg-team/pytorch-frame/pull/433), [#434](https://github.com/pyg-team/pytorch-frame/pull/434))

## [0.2.3] - 2024-07-08
## \[0.2.3\] - 2024-07-08

### Added

Expand All @@ -33,8 +32,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Updated `ExcelFormer` implementation and related scripts ([#391](https://github.com/pyg-team/pytorch-frame/pull/391))


## [0.2.2] - 2024-03-04
## \[0.2.2\] - 2024-03-04

### Added

Expand All @@ -60,14 +58,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed the split of `DataFrameTextBenchmark` ([#358](https://github.com/pyg-team/pytorch-frame/pull/358))
- Fixed empty `MultiNestedTensor` col indexing ([#355](https://github.com/pyg-team/pytorch-frame/pull/355))

## [0.2.1] - 2024-01-16
## \[0.2.1\] - 2024-01-16

### Added

- Support more stypes in `LinearModelEncoder` ([#325](https://github.com/pyg-team/pytorch-frame/pull/325))
- Added `stype_encoder_dict` to some models ([#319](https://github.com/pyg-team/pytorch-frame/pull/319))
- Added `HuggingFaceDatasetDict` ([#287](https://github.com/pyg-team/pytorch-frame/pull/287))

### Changed

- Supported decoder embedding model in `examples/transformers_text.py` ([#333](https://github.com/pyg-team/pytorch-frame/pull/333))
- Removed implicit clones in `StypeEncoder` ([#286](https://github.com/pyg-team/pytorch-frame/pull/286))

Expand All @@ -76,10 +76,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Removed

### Fixed

- Fixed `TimestampEncoder` not applying `CyclicEncoder` to cyclic features ([#311](https://github.com/pyg-team/pytorch-frame/pull/311))
- Fixed NaN masking in `multicateogrical` stype ([#307](https://github.com/pyg-team/pytorch-frame/pull/307))

## [0.2.0] - 2023-12-15
## \[0.2.0\] - 2023-12-15

### Added

Expand All @@ -104,7 +105,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Timestamp` stype ([#212](https://github.com/pyg-team/pytorch-frame/pull/212))
- Added `multicategorical` to `MultimodalTextBenchmark` ([#208](https://github.com/pyg-team/pytorch-frame/pull/208))
- Added support for saving and loading of `TensorFrame` with complex `stypes`. ([#197](https://github.com/pyg-team/pytorch-frame/pull/197))
- Added `stype.embedding` ((#194)[https://github.com/pyg-team/pytorch-frame/pull/194])
- Added `stype.embedding` ([#194](https://github.com/pyg-team/pytorch-frame/pull/194))
- Added `TensorFrame` concatenation of complex stypes. ([#190](https://github.com/pyg-team/pytorch-frame/pull/190))
- Added `text_tokenized` example ([#174](https://github.com/pyg-team/pytorch-frame/pull/174))
- Added Cohere embedding example ([#186](https://github.com/pyg-team/pytorch-frame/pull/186))
Expand All @@ -131,8 +132,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- No manual passing of `in_channels` to `LinearEmbeddingEncoder` for `stype.text_embedded` ([#222](https://github.com/pyg-team/pytorch-frame/pull/222))


## [0.1.0] - 2023-10-23
## \[0.1.0\] - 2023-10-23

### Added

Expand Down
Loading

0 comments on commit 4a9d91b

Please sign in to comment.