Skip to content
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

arraytypes.py is a bit byzantine #46

Closed
yt-fido opened this issue Jun 2, 2011 · 0 comments
Closed

arraytypes.py is a bit byzantine #46

yt-fido opened this issue Jun 2, 2011 · 0 comments
Labels

Comments

@yt-fido
Copy link
Collaborator

yt-fido commented Jun 2, 2011

Originally reported by: The yt Project (Bitbucket: yt_analysis, GitHub: Unknown)


== 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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant