Skip to content

Commit

Permalink
Merge pull request #13 from arnab39/dev
Browse files Browse the repository at this point in the history
0.1.0
  • Loading branch information
danibene authored Mar 15, 2024
2 parents 98c8875 + a1fca2b commit cceb6e3
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 35 deletions.
5 changes: 4 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ formats:
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.10"
jobs:
post_build:
- python docs/postprocess.py --path "$READTHEDOCS_OUTPUT/html"

python:
install:
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

* Arnab Mondal [arnab.mondal@mila.quebec](mailto:arnab.mondal@mila.quebec)
* [Siba Smarak Panigrahi](https://sibasmarak.github.io/) [siba-smarak.panigrahi@mila.quebec](mailto:siba-smarak.panigrahi@mila.quebec)
* [Danielle Benesch](https://github.com/danibene) [daniellerbenesch+git@gmail.com](mailto:daniellerbenesch+git@gmail.com)
* [Jikael Gagnon](https://github.com/jikaelgagnon) [jikael.gagnon@mila.quebec](mailto:jikael.gagnon@mila.quebec)
* [Sékou-Oumar Kaba](https://oumarkaba.github.io)[mailto:kabaseko@mila.quebec]
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Changelog

## Version 0.1 (development)
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

### Fixed

### Changed

### Removed

## [0.1.0] - 2024-03-14

### Added
- Initial version of project on GitHub.
5 changes: 0 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,5 @@ on [PyPI], the following steps can be used to release a new version for
[tox]: https://tox.readthedocs.io/en/stable/
[virtual environment]: https://realpython.com/python-virtual-environments-a-primer/
[virtualenv]: https://virtualenv.pypa.io/en/stable/


```{todo} Please review and change the following definitions:
```

[repository]: https://github.com/arnab39/equiadapt
[issue tracker]: https://github.com/arnab39/equiadapt/issues
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<br>
<img src="utils/equiadapt_logo.png" width="400"/>
<img src="https://raw.githubusercontent.com/arnab39/equiadapt/main/utils/logo.png" width="400"/>
<br>
<p>

Expand All @@ -11,9 +11,9 @@


# Equivariant adaptation with canonicalization
![Equivariant adaptation of any prediction network](/utils/equiadapt_cat.jpeg "Equivariant adaptation of any prediction network")
![Equivariant adaptation of any prediction network](https://raw.githubusercontent.com/arnab39/equiadapt/main/utils/equiadapt_cat.jpeg "Equivariant adaptation of any prediction network")

![Equivariant adaptation of Segment-Anything Network](/utils/equiadapt_sam.gif "Equivariant adaptation of any prediction network")
![Equivariant adaptation of Segment-Anything Network](https://raw.githubusercontent.com/arnab39/equiadapt/main/utils/equiadapt_sam.gif "Equivariant adaptation of any prediction network")

EquiAdapt is a [PyTorch](https://pytorch.org) package that provides a flexible and efficient way to make *any* neural network architecture (including large foundation models) equivariant, instead of redesigning and training from scratch. This is done by learning to canonicalize transformed inputs, before feeding them to the prediction model.

Expand Down
5 changes: 5 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ endif
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

postprocess:
@echo "Running postprocessing script..."
python ./postprocess.py

clean:
rm -rf $(BUILDDIR)/* $(AUTODOCDIR)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(MAKE) postprocess
12 changes: 0 additions & 12 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@

Library that provides metrics to asses representation quality


## Note

> This is the main page of your project's [Sphinx] documentation. It is
> formatted in [Markdown]. Add additional pages by creating md-files in
> `docs` or rst-files (formatted in [reStructuredText]) and adding links to
> them in the `Contents` section below.
>
> Please check [Sphinx] and [MyST] for more information
> about how to document your project and how to configure your preferences.

## Contents

```{toctree}
Expand Down
28 changes: 18 additions & 10 deletions docs/postprocess.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import argparse # Import the argparse module
import re
from pathlib import Path
from typing import Match, Union

from bs4 import BeautifulSoup, Tag

# Install from https://github.com/carpedm20/emoji/
# with pip install emoji
try:
from emoji import emojize
except ImportError:
Expand Down Expand Up @@ -35,25 +34,34 @@ def process_html_file(html_file: Union[str, Path]) -> None:
with open(html_file, "r", encoding="utf-8") as file:
content = file.read()

# Convert emojis in the entire HTML content
content = emojize_all(content)

soup = BeautifulSoup(content, "html.parser")

# Update all <img> tags with src starting with "utils/"
update_image_paths(soup)

# Write the changes back to the HTML file
with open(html_file, "w", encoding="utf-8") as file:
file.write(str(soup))


if __name__ == "__main__":
# Specify the pattern to match the HTML files you want to postprocess
__location__: Path = Path(__file__).parent
html_files: list[Path] = list((__location__ / "_build" / "html").glob("*.html"))
parser = argparse.ArgumentParser(description="Process HTML files.")
parser.add_argument(
"--path",
type=str,
help="Path to the directory containing HTML files to process.",
)

args = parser.parse_args()

if args.path:
base_path = Path(args.path)
else:
__location__: Path = Path(__file__).parent
base_path = __location__ / "_build" / "html"

html_files: list[Path] = list(base_path.glob("*.html"))

for html_file in html_files:
print(f"Processing {html_file}...")
process_html_file(html_file)

print("HTML postprocessing completed.")
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packages = find_namespace:
include_package_data = True

# Require a min/specific Python version (comma-separated conditions)
python_requires = >=3.7
python_requires = >=3.7, <3.11

# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0.
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ commands =


[testenv:{docs,doctests,linkcheck}]
allowlist_externals = make
description =
docs: Invoke sphinx-build to build the docs
doctests: Invoke sphinx-build to run doctests
Expand All @@ -72,8 +73,7 @@ deps =
-r {toxinidir}/docs/requirements.txt
# ^ requirements.txt shared with Read The Docs
commands =
sphinx-build --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}
python docs/postprocess.py
make -C {toxinidir}/docs html

[testenv:publish]
description =
Expand Down
Binary file modified utils/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cceb6e3

Please sign in to comment.