-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: new frame model #46
Conversation
Replace old partial migration with complete one. Lengthen some fields and (hopefully) get the right combination of null/blank... Modify the __unicode__ to handle the case of no filename.
exptime = models.FloatField('Exposure time in seconds', null=True, blank=True) | ||
midpoint = models.DateTimeField('UTC date/time of frame midpoint', null=False, blank=False) | ||
block = models.ForeignKey(Block, null=True, blank=True) | ||
quality = models.IntegerField('Frame Quality', help_text='Frame Quality (-1: unassessed)', default=-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quality would probably be better as a string of comma-separated characters than an integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Oct 29, 2015 at 3:31 PM, sgreenstreet notifications@github.com
wrote:
In neoexchange/core/models.py
#46 (comment):filter = models.CharField('filter class', max_length=15)
- filename = models.CharField(max_length=31)
- exp = models.FloatField('exposure time in seconds')
- whentaken = models.DateTimeField()
- block = models.ForeignKey(Block)
- filename = models.CharField('FITS filename', max_length=40, blank=True)
- exptime = models.FloatField('Exposure time in seconds', null=True, blank=True)
- midpoint = models.DateTimeField('UTC date/time of frame midpoint', null=False, blank=False)
- block = models.ForeignKey(Block, null=True, blank=True)
- quality = models.IntegerField('Frame Quality', help_text='Frame Quality (-1: unassessed)', default=-1)
The quality would probably be better as a string of comma-separated
characters than an integer.—
Reply to this email directly or view it on GitHub
https://github.com/LCOGT/neoexchange/pull/46/files#r43452974.Changing. Does the ADES new MPC format spec list a maximum length for this
quality/notes field?
Dr Tim Lister
Astronomer and Project Scientist
Las Cumbres Observatory (LCOGT.net)
+1 805 880 1989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not state a maximum length. It simply says the notes can be a set of one-character flags to communicate observing circumstances.
This looks good to me. The unit tests passed when I ran them. I just had a couple minor comments. I'm a little hazy on the admin part, however. I tried to add a new frame into the admin page through running the server, but ran into an error (OperationalError at /admin/core/frame/add/; no such table: ingest_frame). I'm not sure where this is coming from. |
On Thu, Oct 29, 2015 at 4:24 PM, sgreenstreet notifications@github.com
Dr Tim Lister |
Alright, I did the migration and restarted the dev. server and everything appears to be working just fine. The unit tests still pass as well. |
Over to Edward for review/sign-off |
site = models.CharField('3-letter site code', max_length=3) | ||
instrument = models.CharField('instrument code', max_length=4) | ||
sitecode = models.CharField('MPC site code', max_length=4) | ||
instrument = models.CharField('instrument code', max_length=4, blank=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want this to not need to be added to the db you will need to add null=True
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Oct 29, 2015 at 5:05 PM, Edward notifications@github.com wrote:
In neoexchange/core/models.py
#46 (comment):'''
- site = models.CharField('3-letter site code', max_length=3)
- instrument = models.CharField('instrument code', max_length=4)
- sitecode = models.CharField('MPC site code', max_length=4)
- instrument = models.CharField('instrument code', max_length=4, blank=True)
If you want this to not need to be added to the db you will need to add
null=True as well.—
Reply to this email directly or view it on GitHub
https://github.com/LCOGT/neoexchange/pull/46/files#r43459886.I thought Austin was against null=True for CharFields?
Dr Tim Lister
Astronomer and Project Scientist
Las Cumbres Observatory (LCOGT.net)
+1 805 880 1989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure what his point was. I think as is, you'll never be able to have the field empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, Oct 29, 2015 at 5:09 PM, Edward notifications@github.com wrote:
In neoexchange/core/models.py
#46 (comment):'''
- site = models.CharField('3-letter site code', max_length=3)
- instrument = models.CharField('instrument code', max_length=4)
- sitecode = models.CharField('MPC site code', max_length=4)
- instrument = models.CharField('instrument code', max_length=4, blank=True)
I wasn't sure what his point was. I think as is, you'll never be able to
have the field empty.—
Reply to this email directly or view it on GitHub
https://github.com/LCOGT/neoexchange/pull/46/files#r43460173.
sitecode should never be empty (we'll always have one of those) but
instrument can be - I think this is tested and proved in the unittests.
Dr Tim Lister
Astronomer and Project Scientist
Las Cumbres Observatory (LCOGT.net)
+1 805 880 1989
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a memory that unittests run on SQLite which accept this, whereas MySQL might not.
Running on my development version with a real MySQL backend, creating a blank Frame in the admin and trying to save it result in errors for the missing site code, filter and midpoint. Filling those in allows the creation of a Frame entry with everything else blank/null. So I think that is working correctly. I have also added some more unittests to check this. |
Do we want to push it to dev today? |
On Fri, Oct 30, 2015 at 11:53 AM, Edward notifications@github.com wrote:
It might be worth trying, but mainly to see if the migrations apply —
Dr Tim Lister |
Hi Sarah (and Edward), I think I'm done with these changes to the Frame model/table, please review.