symbolic icon indicating copy to clipboard operation
symbolic copied to clipboard

pytave dict hacking

Open cbm755 opened this issue 9 years ago • 2 comments

Current implementation may not work correctly if only some of the values are SymPy objects

  • [x] confirmed
  • [ ] make test for that

Also, dicts with SymPy object values but string keys would not be helped by current implementation (?)

  • [x] is that statement true?
  • [ ] make test for that
  • [ ] Here's one possibility:
    1. for every dict, we want to convert any keys that are SymPy objects to strings.
    2. for every dict, we want to convert any keys that are SymPy objects to sym.
  • [ ] There is also the question of what to do in the future when dicts stay as @pyobject: perhaps we ignore this until then?

cbm755 avatar Jun 23 '16 17:06 cbm755

Also, dicts with SymPy object values but string keys would not be helped by current implementation (?)

True. I made this to fix the tests which needed dicts with SymPy objects as keys..

  1. for every dict, we want to convert any keys that are SymPy objects to strings.
  2. for every dict, we want to convert any keys that are SymPy objects to sym.

I tried this but could not think of a way to only partially convert a dict in octave. If we are to support this then we will have to do all the conversions in octave... Maybe call pyeval on each element instead..

There is also the question of what to do in the future when dicts stay as @pyobject: perhaps we ignore this until then?

I think yes. Because there can be nested dicts and whatnot.. So, instead of focusing on this, wouldn't it be better to focus more on speeding the development on @pyobject? (Just my view)

genuinelucifer avatar Jun 23 '16 18:06 genuinelucifer

I think I agree with all that.

cbm755 avatar Jun 23 '16 18:06 cbm755