Skip to content

Commit

Permalink
add code
Browse files Browse the repository at this point in the history
  • Loading branch information
salvaRC committed Dec 5, 2024
1 parent 63fc4cb commit dade5ae
Show file tree
Hide file tree
Showing 161 changed files with 28,712 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run code quality checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

check_code_quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: |
ruff check scripts src utils --fix
# black --check tests src scripts utils
# doc-builder style src docs/source --max_len 119 --check_only --path_to_docs docs/source

check_repository_consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: |
python utils/check_copies.py
make deps_table_check_updated
221 changes: 221 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# Project specific

results/
data/*.nc
data/*.csv
data/*.h5
data/*.json
data/*.pkl
data/*.npy
data/*.npz
data/*.mat
data/*.txt
data/*.zip
data/*.tar
data/*.tar.gz
data/*.tar.bz2
*.ckpt
*.pt
stats/
predictions/
predictions/*
# Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
# Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks

### JupyterNotebooks ###
# gitignore template for Jupyter Notebooks
# website: http://jupyter.org/

.ipynb_checkpoints
*/.ipynb_checkpoints/*

# IPython
profile_default/
ipython_config.py

# Remove previous ipynb_checkpoints
# git rm -r .ipynb_checkpoints/

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook

# IPython

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
# Pycharm
.idea
.idea/**
**/.idea


# Ruff
.ruff_cache

#.DS_Store
.DS_Store
**/.DS_Store

# logging
src/results/**
src/results/wandb/**
src/results/logs/**
src/configs/local/default.yaml
results/checkpoints/**
results/wandb/**
results/logs/**
outputs/**
wandb/**

tmp.sh
tmp.py

# Gifs in docs/
docs/*.gif

*.jpg
*.txt
*.txt~
*.tgz

logs/**

notebooks/*.gif

videos/**
scripts/_servers/*

# all inference configs that start with '_'
src/configs/inference/_*

15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3
types: [python]
stages: [commit]
args: ["--config", "pyproject.toml", "tests", "src", "scripts"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.255'
hooks:
- id: ruff
stages: [commit]
args: [ "--config", "pyproject.toml", "tests", "src", "scripts", "--fix"]
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# How to contribute to DYffusion?
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)

Spherical DYffusion is an open source project, so all contributions and suggestions are welcome.

You can contribute in many different ways: giving ideas, answering questions, reporting bugs, proposing enhancements,
improving the documentation, fixing bugs,...

Many thanks in advance to every contributor.

In order to facilitate healthy, constructive behavior in an open and inclusive community, we all respect and abide by
our [code of conduct](CODE_OF_CONDUCT.md).

## How to work on an open Issue?
You have the list of open Issues at: https://github.com/Rose-STL-lab/spherical-dyffusion/issues

Some of them may have the label `help wanted`: that means that any contributor is welcomed!

If you would like to work on any of the open Issues:

1. Make sure it is not already assigned to someone else. You have the assignee (if any) on the top of the right column of the Issue page.

2. You can self-assign it by commenting on the Issue page with the keyword: `#self-assign`.

3. Work on your self-assigned issue and eventually create a Pull Request.

## How to create a Pull Request?

1. Fork the [repository](https://github.com/Rose-STL-lab/dyffusion) by clicking on the 'Fork' button on the repository's page. This creates a copy of the code under your GitHub user account.

2. Clone your fork to your local disk, and add the base repository as a remote:

```bash
git clone [email protected]:<your Github handle>/spherical-dyffusion.git
cd spherical-dyffusion
git remote add upstream https://github.com/Rose-STL-lab/spherical-dyffusion.git
```

3. Create a new branch to hold your development changes:

```bash
git checkout -b a-descriptive-name-for-my-changes
```

**do not** work on the `main` branch.

4. Set up a development environment by running the following command in a virtual environment:

```bash
pip install -e ".[dev]"
```

(If `spherical_dyffusion` was already installed in the virtual environment, remove
it with `pip uninstall spherical_dyffusion` before reinstalling it in editable
mode with the `-e` flag.)

5. Develop the features on your branch.

6. Format your code. Run `black` and `ruff` so that your newly added files look nice with the following command:

```bash
make style
```

7. _(Optional)_ You can also use [`pre-commit`](https://pre-commit.com/) to format your code automatically each time run `git commit`, instead of running `make style` manually.
To do this, install `pre-commit` via `pip install pre-commit` and then run `pre-commit install` in the project's root directory to set up the hooks.
Note that if any files were formatted by `pre-commit` hooks during committing, you have to run `git commit` again .
8. Once you're happy with your contribution, add your changed files and make a commit to record your changes locally:

```bash
git add -u
git commit
```

It is a good idea to sync your copy of the code with the original
repository regularly. This way you can quickly account for changes:

```bash
git fetch upstream
git rebase upstream/main
```

9. Once you are satisfied, push the changes to your fork repo using:

```bash
git push -u origin a-descriptive-name-for-my-changes
```

Go the webpage of your fork on GitHub. Click on "Pull request" to send your to the project maintainers for review.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Salva Rühling Cachay

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading

0 comments on commit dade5ae

Please sign in to comment.