stumelius / cranio Goto Github PK
View Code? Open in Web Editor NEWForce measurements, data analysis and visualization in posterior calvarial vault osteodistraction (PCVO) using a torque sensor and Python
License: GNU General Public License v3.0
Force measurements, data analysis and visualization in posterior calvarial vault osteodistraction (PCVO) using a torque sensor and Python
License: GNU General Public License v3.0
For GitHub, Travis CI is the recommended
Set up a basic CI pipeline that:
pip install .
This is the "Hello World" verion of a CI system, but requires you to read up a bit on getting the basics running.
A minimal Travis setup looks like:
language: python
python:
- 3.6
- nightly
script:
- pip install -r requirements.txt
- pip install .
Add session_id foreign key constraint to Log table to avoid orphaned logs.
Furthermore, having a foreign key constraint between logs and documents prevents logging prior to document initialization.
Hi!
You recently contacted me on Reddit for part project management tutoring, so let's get the ball rolling (Filing issue #1)
Start by adding a README that documents:
In the commit message, mention:
Issue #1
or Closes #1
Add maximize button to RegionPlotWindow
CI (Travis) is already included. Explore possibility for code quality checks, such as coverage. See https://help.github.com/articles/about-status-checks/#checks
Meta info locking in the main window is to be applied only to the patient field
PlotWidget does not currently have axis labels
Implement the main dialog as a QMainWindow with a menubar.
Instead of having a single "+" / "Add" button for adding an event region to the region widget, there is a field where user inputs the number of events and clicks "Ok" / "Add".
Methods:
Attributes:
User is able to view and edit event identifiers for each distraction event. Event identifier is autofilled (D001, D002, etc.).
Instead of a long "craniodistractor", use "cranio" or "CranIO". Compare the two:
from craniodistractor.core import Packet
vs
from cranio.core import Packet
The latter looks cleaner and is faster to write.
Check that there are no existing projects in PyPi under the name "cranio"
Rename github repo
Update remote URL on local repositories
Add missed distraction checkbox to RegionPlotWindow. Requires a "recorded" flag in the AnnotatedEvent data model.
Design a data model for storing recorded and meta data
Implement a producer that is run in a separate process.
producer can have multiple sensors
sensor can have multiple channels (DAQ support)
producer information (sensors and channels) is stored in a container
implement Imada torque sensor
Producer can be started and stopped. Start reads data from all its sensors and puts it in a data pipe or queue until the producer is stopped.
Implemented a sensor info table in the relational data model. Example:
CREATE TABLE SensorInfo{
STRING serial_number,
STRING hw_name,
NUMERIC turns_in_full_turn,
NUMERIC displacement_mm_per_full_turn
};
Default sensor: Imada torque sensor.
NOTE: Keep in mind when designing the model that there may be different types of sensors used by the application. In the typical use case there is only a torque sensor but in calibration there will also be a load cell.
travis-ci.org\smomni\craniodistractor -> travis-ci.org\smomni\cranio
Integrate daqstore to this project and add https://github.com/smomni/daqstore.git to dependencies
The user inserts the distractor index into the measurement window. The distractor index is passed onto the event detection window when the measurement ends.
Distraction events are associated with the distractor index.
Write stub documentation using sphinx. A simple configuration example: https://medium.com/@richyap_13562/a-simple-tutorial-on-how-to-document-your-python-project-using-sphinx-and-rinohtype-177c22a15b5b
Related to #63
The following meta data is collected for each session (= every time software is started):
Patient ID prompt is shown on software startup. The prompt has two input fields: Patient and Session. Session input field is disabled and just shows the random generated id. The input fields have Help buttons for providing information to the user.
Write a log handler that pushes log entries to a database
See https://docs.pylonsproject.org/projects/pyramid-cookbook/en/latest/logging/sqlalchemy_logger.html
Extract: from old .txt files
Transform: (re)name columns
Load: to a simple database (sqlite)
Instead of having an "event_id" column along the raw data, include the event information in a separate table. For example:
CREATE TABLE AnnotatedEvents(
event_type VARCHAR(20),
event_num INTEGER,
document_id VARCHAR(20),
event_begin NUMERIC,
event_end NUMERIC,
PRIMARY KEY (event_type, event_num, document_id),
FOREIGN KEY (document_id) REFERENCES Document(document_id)
ON UPDATE CASCADE
);
Implement a widget where the user can add patients to the database. The user must be able to see the existing patients.
Travis configuration does not yet include unit testing
Add PyQt4 installation to travis configuration
Add unit testing to travis configuration
Extract old data and annotate each distraction event. Write a script for graphical annotation by utilizing the region widgets implemented in cranio.
Data files are displayed in order. User adds regions to each file and clicks OK to accept the regions. The regions are updated to source data once the selected regions are accepted. User is able to navigate between files (Next / Previous).
Design the structure for how documents are stored on disk as flat files.
I'd suggest a rather simple, but structured workflow:
File issues for those features you're looking to get. They can be small or big, as long as they are solveable.
you should be able to tell when something is done from reading the issue. Too open ended and it cannot be closed.
Develop those issues
Commits should touch one thing, preferrably, with a label that matches the code. IE, a change that reads "reformat foo" shouldn't add new features, etc.
Open an Pull request /MR for your own review from the branch to master
Try to keep the commits on an MR branch below a dozen.
Keep the MR open for 24 hours, give people the chance to comment and look at it.
Review that the changes in there look decent
It's a perfectly valid workflow to sit down and hack, realize you just built a feature, then file an issue for this feature. It's even commendable.
The goal is to get the habit in of referring to your issues, and opening code review points before merging directly to master.
"But I'm the only developer here?!" you may think, and yes. That's why it's good to practice now.
Add version attribute to cranio/init.py
The database model contains Float (IEEE 754) columns which may lead to inaccuracies in decimal representation (conversion from base-10 to base-2). Replace the Float columns with Numeric.
From SQLAlchemy documentation:
"The Enum type will make use of the backend’s native “ENUM” type if one is available; otherwise, it uses a VARCHAR datatype and produces a CHECK constraint. Use of the backend-native enum type can be disabled using the Enum.native_enum flag, and the production of the CHECK constraint is configurable using the Enum.create_constraint flag."
Write a lookup table and populate it:
CREATE TABLE LogLevel(
level VARCHAR(20) PRIMARY KEY,
level_priority INTEGER NOT NULL,
);
INSERT INTO LogLevel VALUES ('NOTSET', 0), ('DEBUG', 10), ('INFO', 20), ('WARNING', 30), ('ERROR', 40), ('CRITICAL', 50);
CREATE TABLE Log(
log_id INT PRIMARY KEY AUTO_INCREMENT,
...
level VARCHAR(20),
FOREIGN KEY (level) REFERENCES LogLevel(level)
ON UPDATE CASCADE
);
The logging levels are the same as in the Python 3 logging module (see https://docs.python.org/3/library/logging.html).
VMultiPlotWidget shows nothing by default which displays as an empty widget before data is plotted. Instead of an empty widget, show a placeholder grid.
Design and implement a DED algorithm.
Design: find references from scientific literature
In case multiple patients are treated during a single session. Very unlikely but this is a very minor denormalization.
The data model image in docs/ is outdated
Remove old and/or redundant requirements from requirements.txt
Replace session_id with distractor_id in the main window. session_id is to be hidden from the user
PlotWidget starts and stops producer processes which should not be included in PlotWidget's responsibilities. Either rename PlotWidget as ProducerPlotWidget or improve encapsulation in some other way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.