ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

Separate files for new color model #588

Closed Tobias-Fischer closed 10 years ago

Tobias-Fischer commented 10 years ago

This PR introduces two new files, earlyvision_color.py and gcal_color.py. In earlyvision_color.py, EarlyVisionModel is extended to include color related code for the visual pathway. gcal_color.py is nearly an exact copy of gcal.py, except that some code related to color_scale and measurement for color is added. This is a temporary solution to replicate the results of fischer:ms14. As soon as a modular model structure is possible, most of the duplication will be able to be removed.

jbednar commented 10 years ago

Tobias, would you be able to change gcal_color.py so that it is split into two classes, one of them an exact copy of ModelGCAL (maybe called ModelGCALInheritingColor?) that simply inherits from EarlyColorVisionModel instead of EarlyVisionModel, and the other one showing precisely these changes that you're making? It's going to be hard enough to maintain this already, but at least if we know that the first class is meant to be an exact copy, we'll be able to cut and paste any subsequent changes we need. And that way I'll be able to see what the color-related changes are; right now those are obscured.

jbednar commented 10 years ago

And personally, I'd just put it all into one file color.py, because eventually the copy of GCAL shouldn't be needed, meaning that this file should be relatively short.

Tobias-Fischer commented 10 years ago

Hi Jim, I implemented the suggested split into two classes. I thought about this particular case again, and I am pretty sure ModelGCALInheritingColor could be somehow avoided by using multiple inheritance. But I haven't worked with multiple inheritance in Python before, so I might be wrong. I do think though it's worth keeping in mind. For now, I kept two separate files. As soon as modular models are feasible, I agree that the files should be merged.

jbednar commented 10 years ago

Ok, thanks!