Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
npeard committed May 2, 2024
0 parents commit bb062f4
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
134 changes: 134 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# 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/
pip-wheel-metadata/
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/

# 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
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.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/
.idea/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

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

# Pyre type checker
.pyre/

# training data
data/*
checkpoints/*
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/self-interferometry.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# mm-wave Lab Physics Models

This is our repository of shared code for calculations of
interest to mm-wave Lab.

For a minimal working example of the format and function we are going for,
please see the "/models/gatefidelity.py", "/plotters/plot_gatefidelity.py",
and "/notebooks/GateErrors.ipynb" collection.

## Introduction
The idea is that all calculation-heavy code will be placed in the /models
directory. These are calculations that everyone will use; therefore, the
source code should be re-used and scrutinized often to check for factors of
$2\pi$, sign errors, etc. Use these models for larger calculations and plots,
and everyone will understand where the underlying code came from, there will
be fewer silly mistakes, and hence shorter discussions and meetings!

If you make a very complex plot, or multiple plots for the same model, you
should write a Python file that contains your plotting functions and
avoid cluttered Jupyter notebooks. These files should be named with the
prefix "plot_X.py" and placed in the /plotters directory.

Finally, your stunning Jupyter notebook can go in the /notebooks
directory. The notebook should call functions and classes that are
implemented either in /plotters or in /models to benefit from the shared
(error-checked) code base. These notebooks can be individualized to
your specific use case, but they should still be synced to the Github repo.

You can edit the Python code in the repo and your Jupyter notebook
simultaneously. Restart your Jupyter kernel to reload any Python code you
edit in your Python IDE.

## Contributing
Whenever you want to edit or add to the repo, checkout a new Git branch.

Make your edits, making commits and pushing code to your branch as
you go.

Create a pull request for your branch. One colleague needs to review and
approve your code before you can merge your branch. Consider using the
automated PyLinter to edit your code to match the PEP8 style guide.

Once your code is approved, merge commit the branch and then delete it.

Repeat as necessary.
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pycodestyle]
max-line-length = 120

[pydocstyle]
ignore = D100, D101, D102, D107
10 changes: 10 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import unittest


class MyTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(True, False) # add assertion here


if __name__ == '__main__':
unittest.main()

0 comments on commit bb062f4

Please sign in to comment.