Rewrite conversion stuff to use new pytave features #512

Merged
merged 11 commits into from Aug 22, 2016

Projects

None yet

2 participants

@genuinelucifer
Contributor

Re-did the PR to pytave branch...

@genuinelucifer
Contributor

@cbm755 Please review this / merge if it's okay...

@cbm755 cbm755 and 1 other commented on an outdated diff Aug 19, 2016
inst/private/check_and_convert.m
if is_list_curvar
- obj{i} = check_and_convert(cur_var);
- elseif is_dict_with_sym_keys_curvar
- %if cur_var is dictionary with symbols as keys then convert it to a struct
- pyexec(strjoin({'_allKeysStr = []',
- '_allValues = []',
- ['for key, value in ' cur_var '.iteritems():'],
- ' _allKeysStr.append(str(key))',
- ' _allValues.append(value)'}, newl));
- _allKeysStr = pyeval('_allKeysStr');
+ obj{i} = check_and_convert(cur_pyobj);
+ elseif dict_to_struct
+ %if cur_var is dictionary with symbols/strings as keys then convert it to a struct
+ %TODO: will be better after https://bitbucket.org/mtmiller/pytave/issues/62 is resolved
@cbm755
cbm755 Aug 19, 2016 Owner

is this done now?

@genuinelucifer
genuinelucifer Aug 19, 2016 Contributor

My laptop isn't working from couole of days, I have given it for repairs. I'll check this as soon as I get my laptop back. I think it should be working now as upstream has struct conversion now.

@cbm755
Owner
cbm755 commented Aug 19, 2016
and others added some commits Aug 21, 2016
@cbm755 Use struct for pytave dict converting, and clean up 252278e
@cbm755 new-style copyright header (one name per line) 128094d
@cbm755 Python 3 fix
Maybe it just works around pytave bug, but I also found this code
unclear.  Left a TODO as still could be improved.
c16c783
@genuinelucifer genuinelucifer Merge pull request #4 from cbm755/proper_checkNconvert_cbm
use struct, other fixes
84bb99f
@cbm755 cbm755 merged commit 84bb99f into cbm755:pytave Aug 22, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@cbm755
Owner
cbm755 commented Aug 22, 2016

my pytave branch wasn't working with master anyway, so merged there. Maybe not quite ready for master yet.

@genuinelucifer genuinelucifer deleted the genuinelucifer:proper_checkNconvert branch Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment