1. Matt
  2. trac_convert
Issue #63 new

arraytypes.py is a bit byzantine

Matt
repo owner created an issue

== Imported Ticket == * Summary: arraytypes.py is a bit byzantine * Component: yt * Milestone: * Reporter: joishi * Owner: mturk * Resolution: fixed * Status: closed * Created: 1197048248000000 * Description:** why is numpy imported as na '''and''' obj? this is very confusing, especially for new users. in lagos, references to nT, na, and obj are scattered throughout. i assume this was to support some kind of easy switching between numpy and numarray, but it seems to me that the days of support for both are past. if we eliminate any trace of numarray, will nT still be necessary?

given Matt's comment in the header of arraytypes.py, perhaps this should be re-factored sooner rather than later?

=== Update to Ticket === * Author: joishi * Changetime: 1197048654000000 * Field: owner * Oldvalue: mturk * Newvalue: joishi

=== Update to Ticket === * Author: joishi * Changetime: 1197048654000000 * Field: comment * Oldvalue: 1 * Newvalue:

=== Update to Ticket === * Author: joishi * Changetime: 1197051576000000 * Field: comment * Oldvalue: 2 * Newvalue: i did a quick grep for "obj\." in the yt src tree. doesn't look like there are too many places to replace it if we want to.

{{{ [joishi@skronk src]$ ls init.py config.py enki funcs.py logger.py raven setup.py arraytypes.py deliverator fido lagos progressbar.py reason setup.pyc [joishi@skronk src]$ grep "obj\." /py lagos/EnzoRunType.py: self.outputs = obj.array(outputs) # Object array of EnzoHierarchies lagos/EnzoRunType.py: self.outputs = obj.array(self.outputs.tolist() + hierarchy) lagos/EnzoRunType.py: newOutputs = obj.array(self.outputs[:id].tolist() + self.outputs[id+1:].tolist()) lagos/EnzoRunType.py: newTimesteps = obj.array(self.timesteps[:id].tolist() + self.timesteps[id+1:].tolist()) lagos/HierarchyType.py: self.grids = obj.array([self.grid(i+1) for i in xrange(self.numGrids)]) [joishi@skronk src]$ grep "obj\." //py deliverator/deliverator/json.py:# return [obj.val1, obj.val2] deliverator/deliverator/json.py: result["users"] = [u.user_name for u in obj.users] deliverator/deliverator/json.py: result["permissions"] = [p.permission_name for p in obj.permissions] deliverator/deliverator/json.py: result["groups"] = [g.group_name for g in obj.groups] deliverator/deliverator/json.py: result["permissions"] = [p.permission_name for p in obj.permissions] deliverator/deliverator/json.py: result["groups"] = [g.group_name for g in obj.groups] [joishi@skronk src]$ grep "obj\." ///*py deliverator/deliverator/tests/test_model.py:# assert obj.display_name == "Mr Creosote"

}}}

=== Update to Ticket === * Author: mturk * Changetime: 1197059195000000 * Field: status * Oldvalue: new * Newvalue: assigned

=== Update to Ticket === * Author: mturk * Changetime: 1197059195000000 * Field: owner * Oldvalue: joishi * Newvalue: mturk

=== Update to Ticket === * Author: mturk * Changetime: 1197059195000000 * Field: comment * Oldvalue: 3 * Newvalue: I have started fixing this in the unstable branch. (obj, for instance, should be completely eradicated.) I completely agree, arraytypes should largely be done away with, and any functions that actually do serve a purpose should be tossed into funcs.py.

The unstable branch will be moved over to the trunk early next week, since I have tagged release-0.2.1.

=== Update to Ticket === * Author: mturk * Changetime: 1197178721000000 * Field: comment * Oldvalue: 4 * Newvalue: Corrected in branches/unstable-0.3, will close when unstable-0.3 becomes trunk next week.

=== Update to Ticket === * Author: mturk * Changetime: 1197938247000000 * Field: status * Oldvalue: assigned * Newvalue: closed

=== Update to Ticket === * Author: mturk * Changetime: 1197938247000000 * Field: resolution * Oldvalue: * Newvalue: fixed

=== Update to Ticket === * Author: mturk * Changetime: 1197938247000000 * Field: comment * Oldvalue: 5 * Newvalue:

Comments (0)

  1. Log in to comment