Compare commits

..

4 Commits

3 changed files with 14 additions and 0 deletions

12
REVIEW.md Normal file
View File

@@ -0,0 +1,12 @@
# Code Review Changes
Original tables with verbatim feedback can be found in [this Google Doc](https://docs.google.com/document/d/19d5U-ieQyGVVNQjj0rUouzIqF53evEP6yss-wyqNXiQ/edit?usp=sharing).
|Comment|Adjustment|
|-------|----------|
|The `models.py` file is too difficult to understand.| `models.py` updated with Python docstrings.|
|The code in general is not commented.| Every function in the codebase commented with Python docstring to explain usage and implementation. Some comments added to functions longer than a few lines.|
|It's difficult to set up the server software.| `requirements.txt` file updated with all packages; `default.nix` provided via `README.md` to provide alternative installation method.|
|No README file.| README file added with installation and configuration instructions.|
|No unit tests.| Developed [cow description language](https://dev.danilafe.com.CS-46x/cdl.git) to test database access (tests still need to be run manually, due to time constraints).
|Unrolled list of variables can be converted to list.| Unrolled fields kept to maintain isomorphism with hardware, where unrolling variables is necessary due to hardware and radio limitations. Methods written to limit the need for manually accessing `coord*x` and `coord*y` variables.|

View File

@@ -85,6 +85,7 @@ class BoundingBox(db.Model):
id = db.Column(db.Integer, primary_key=True)
collar_id = db.Column(db.Integer, db.ForeignKey('collar.id'))
num_points = db.Column(db.Integer)
needs_push = db.Column(db.Boolean)
coord0x = db.Column(db.Float(precision=10))
coord0y = db.Column(db.Float(precision=10))
coord1x = db.Column(db.Float(precision=10))

View File

@@ -164,6 +164,7 @@ def collar_set_boundary(id):
if collar is None: abort(404)
new_boundary = flatten(request.json)
new_boundary.needs_push = True
if collar.boundary is not None:
db.session.delete(collar.boundary)
collar.boundary = new_boundary