Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Convert Subjects into POJOs when making Recents #38

Closed
wants to merge 2 commits into from

Conversation

edpaget
Copy link
Contributor

@edpaget edpaget commented Jun 25, 2014

Prevents duplicate subjects from being shown, by making sure destroyed
subjects aren't readded to the subject queue when they're made into a
recent

Prevents duplicate subjects from being shown, by making sure destroyed
subjects aren't readded to the subject queue when they're made into a
recent
edpaget referenced this pull request in zooniverse/Asteroid-Zoo Jun 25, 2014
Delete subjects before adding training
@edpaget
Copy link
Contributor Author

edpaget commented Jun 25, 2014

So I added a console.trace; console.log(Subject.instances.map((s) -> s.zooniverse_id)) to the Subject constructor when I was testing. After each classification, the Subject constructor was being called, as expected, from its child class SubjectForRecent, but the subject it was being called was being added to back into the Subject.instances array.

Adding a console.log(@constructor) to the BaseModel constructor confirmed that, at least in Firefox, the Subject object that had been passed to SubjectFromRecent still had this.constructoras Subject. And my console.log(Subject.instances.map((s) -> s.zooniverse_id)) confirmed that it was being added back to the Subject.instances array.

@brian-c
Copy link
Contributor

brian-c commented Jun 25, 2014

Bizarre. I can't duplicate that behavior here. Want to just point Asteroid Zoo at this commit until we can figure out why it's doing this?

I think hard coding the keys in a subject is going to break the new Planet Hunters, where subjects come back with non-standard keys.

Maybe pass in JSON.parse JSON.stringify subject?

Eh, I want to look at this more tomorrow.

@edpaget
Copy link
Contributor Author

edpaget commented Jun 25, 2014

Yeah I was thinking of using json parsing as well.I'll switch to that then
point Asteroid at it.

It could just be something weird happening in asteroid zoo. Although I was
seeing complaints about duplicates on the Condor Watch talk, which I think
also uses this version of the library.
On Jun 25, 2014 8:28 AM, "Brian Carstensen" [email protected]
wrote:

Bizarre. I can't duplicate that behavior here. Want to just point Asteroid
Zoo at this commit until we can figure out why it's doing this?

I think hard coding the keys in a subject is going to break the new Planet
Hunters, where subjects come back with non-standard keys.

Maybe pass in JSON.parse JSON.stringify subject?

Eh, I want to look at this more tomorrow.


Reply to this email directly or view it on GitHub
#38 (comment).

@edpaget
Copy link
Contributor Author

edpaget commented Jun 25, 2014

@aweiksnar and I confirmed that the same behaviour happens for him in Chrome on OS X as well.

chrissnyder added a commit that referenced this pull request Jul 14, 2014
@edpaget
Copy link
Contributor Author

edpaget commented Jul 15, 2014

#40 is waaaaaay beter

@edpaget edpaget closed this Jul 15, 2014
chrissnyder added a commit that referenced this pull request Jul 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants