commit dc77bff181f26ed8d668f713ba994579f1a24f8a Author: Taylor Bockman Date: Tue Aug 6 21:08:53 2019 -0700 init commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a214ae5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,176 @@ +# 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 +.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 + +# celery beat schedule file +celerybeat-schedule + +# 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/ + + +### Emacs + +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ba21a73 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to ClusterView + +## PR Requirements + +Before a PR is accepted it must pass the following requirements in CircleCI: + +- [ ] All tests must pass +- [ ] The code must be lint free as determined by `flake8` + +Additionally, any new code included in the PR must be tested fully. + +## Developer Requirements + +You will want to make sure that all developer requirements are installed. To +do this after creating a new `virtualenv` environment: + + +```sh +pip3 install -r requirements-dev.txt +``` + +This will install all normal requirements as well as testing requirements. + +## Linting + +We use `flake8` for linting. + +## Running Tests + +We use `pytest` as our testing framework. + + +TODO + +## Style + +### Import Organization + +Import organization is a critical part of good software engineering. In large +projects considerable time can be wasted looking for a specific import. +The imports must be organized as follows: + +```python + +# System imports first + +# Third party imports second + +# UNLV/ClusterView modules external to the current module third + +# Modules local to the current module last +``` + diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed9fcab --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# ClusterView + +A project for viewing, manipulating, and learning clustering algorithms in Computational Geometry. + + +## Running + +First, make sure you have python installed. If not, follow the installation instructions for your +distribution. + +First: + +```sh +sudo pip3 install virtualenv +``` + +To make sure you have a working `virtualenv`. + +Now, start `virtualenv`: + +```sh +virtualenv venv +source venv/bin/activate +``` + +You should see `(venv)` prefixing your command line. + +Now, install the requirements: + +```sh +pip3 install -r requirements.txt +``` + +This will insure all pre-requisites are installed. You will need the [Qt Framework](https://www.qt.io/) installed as well. + +Finally, run: + +```sh +python3 clusterview.py +``` + +To start the software. diff --git a/clusterview.py b/clusterview.py new file mode 100644 index 0000000..7a72c40 --- /dev/null +++ b/clusterview.py @@ -0,0 +1,17 @@ +import sys + +from PyQt5.QtWidgets import QApplication + +from main_window import MainWindow + + +def main(): + app = QApplication(sys.argv) + + window = MainWindow() + + sys.exit(app.exec_()) + + +if __name__ == '__main__': + main() diff --git a/clusterview.ui b/clusterview.ui new file mode 100644 index 0000000..d251c15 --- /dev/null +++ b/clusterview.ui @@ -0,0 +1,123 @@ + + + MainWindow + + + + 0 + 0 + 1280 + 720 + + + + + 0 + 0 + + + + + 1280 + 720 + + + + ClusterView + + + + + + + + + + + + 0 + 0 + 1280 + 28 + + + + true + + + + File + + + + + Help + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + + + + Add Points + + + Enables point adding mode. + + + Ctrl+A + + + + + Edit Points + + + Enables point editing mode. + + + Ctrl+E + + + + + Delete Points + + + Enables point deletion mode. + + + Ctrl+D + + + + + Solve + + + Opens the solve dialog to choose a solving solution. + + + Ctrl+S + + + + + + diff --git a/clusterview/__init__.py b/clusterview/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/documentation.tex b/documentation.tex new file mode 100644 index 0000000..659f15d --- /dev/null +++ b/documentation.tex @@ -0,0 +1,14 @@ +\title{ClusterView Documentation} + +Taylor Bockman + + + +Right now this is just notes for things below: + + +All hotkeys (add, delete, edit, solve, etc) + +Overview of the various supported algorithms in the solve system. + +Etc \ No newline at end of file diff --git a/main_window.py b/main_window.py new file mode 100644 index 0000000..4ef53e8 --- /dev/null +++ b/main_window.py @@ -0,0 +1,26 @@ +import os + +from PyQt5 import QtWidgets, uic + +class MainWindow(QtWidgets.QMainWindow): + """ + A wrapper class for handling creating a window based + on a Qt Designer *.ui file. + """ + + # This file will always live in the root so we can yank + # the root directory from it's location safely. + __ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) + + __UI_FILE_NAME = "clusterview.ui" + + def __init__(self): + """ + Initializes and launches the UI in one shot. + """ + + # Assumption: The UI file will be in the project root. + + super(MainWindow, self).__init__() + uic.loadUi("{}/{}".format(self.__ROOT_DIR,self. __UI_FILE_NAME)) + self.show() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f45d0e7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,16 @@ +backcall==0.1.0 +decorator==4.4.0 +ipython==7.7.0 +ipython-genutils==0.2.0 +jedi==0.14.1 +parso==0.5.1 +pexpect==4.7.0 +pickleshare==0.7.5 +prompt-toolkit==2.0.9 +ptyprocess==0.6.0 +Pygments==2.4.2 +PyQt5==5.13.0 +PyQt5-sip==4.19.18 +six==1.12.0 +traitlets==4.3.2 +wcwidth==0.1.7