{"action":"created","issue":{"url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/1","labels_url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/1/comments","events_url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/1/events","html_url":"https://github.com/robertsdwyer/PSLv3/pull/1","id":64151522,"number":1,"title":"added parser logic","user":{"login":"robertsdwyer","id":4614990,"avatar_url":"https://avatars.githubusercontent.com/u/4614990?v=3","gravatar_id":"","url":"https://api.github.com/users/robertsdwyer","html_url":"https://github.com/robertsdwyer","followers_url":"https://api.github.com/users/robertsdwyer/followers","following_url":"https://api.github.com/users/robertsdwyer/following{/other_user}","gists_url":"https://api.github.com/users/robertsdwyer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertsdwyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertsdwyer/subscriptions","organizations_url":"https://api.github.com/users/robertsdwyer/orgs","repos_url":"https://api.github.com/users/robertsdwyer/repos","events_url":"https://api.github.com/users/robertsdwyer/events{/privacy}","received_events_url":"https://api.github.com/users/robertsdwyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-25T02:22:28Z","updated_at":"2015-03-25T19:30:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/robertsdwyer/PSLv3/pulls/1","html_url":"https://github.com/robertsdwyer/PSLv3/pull/1","diff_url":"https://github.com/robertsdwyer/PSLv3/pull/1.diff","patch_url":"https://github.com/robertsdwyer/PSLv3/pull/1.patch"},"body":"Hey D. Still a bit green with github, but let's see if this pull request works like I expect.  I added parser logic.  The issue I ran into was that I wrote a lot of cleaning functions as methods on the user, portfolio, and object classes.  So what I did was to create new files like \"parserPortfolioSLH\", which contain user, portfolio, and loan analog classes, in this case a portfolio analog.  All the cleaning functions are now methods in this class.  (I have yet to delete the cleaning functions from the regular classes... I'll have to remember to do that.)  Anyway, the classes are called by parserSLH.py, which accepts the raw xml input from SLH as input and returns a parserUserSLH object, which looks like a User.  The idea is that we'll make the contents of this user object (not the functions) look the same for every parser, and this user object will be passed to the User class to initialize it.  By this point we've cleaned all inputs and converted to established naming conventions.  I changed the User class init function to now accept this parserUser object, which it uses to initialize via setattr().  I think this is a good shell, although we can obviously modify inputs and outputs to the parser and User class further."},"comment":{"url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/comments/86183725","html_url":"https://github.com/robertsdwyer/PSLv3/pull/1#issuecomment-86183725","issue_url":"https://api.github.com/repos/robertsdwyer/PSLv3/issues/1","id":86183725,"user":{"login":"robertsdwyer","id":4614990,"avatar_url":"https://avatars.githubusercontent.com/u/4614990?v=3","gravatar_id":"","url":"https://api.github.com/users/robertsdwyer","html_url":"https://github.com/robertsdwyer","followers_url":"https://api.github.com/users/robertsdwyer/followers","following_url":"https://api.github.com/users/robertsdwyer/following{/other_user}","gists_url":"https://api.github.com/users/robertsdwyer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertsdwyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertsdwyer/subscriptions","organizations_url":"https://api.github.com/users/robertsdwyer/orgs","repos_url":"https://api.github.com/users/robertsdwyer/repos","events_url":"https://api.github.com/users/robertsdwyer/events{/privacy}","received_events_url":"https://api.github.com/users/robertsdwyer/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T19:30:02Z","updated_at":"2015-03-25T19:30:02Z","body":"I disagree. I don't think there's any way you can clean the data without\ninstantiating user, portfolio, and loan objects. There are far too many\ncalculations to make on those classes.\n\nOn Wed, Mar 25, 2015 at 2:42 PM, Derek Kaknes <notifications@github.com>\nwrote:\n\n> Yeah, but the parsers shouldn't be initializing new objects: I think each\n> parser should be a standalone class that inherits from NullParser, intakes\n> a data source and outputs a data structure (probably just a dictionary, but\n> not a full User object). We shouldn't need to have parserUser or\n> parserPortfolio objects, because we shouldn't need to actually instantiate\n> any of them to parse the data source. And since we are relying on the\n> parsers to handle data conversion, we should make the models much more\n> strict about their input fields and have accompanying Exceptions to\n> indicate when and where those inputs may be erroneous. I am going to make a\n> few more changes tonight and hopefully outline what I'm thinking more\n> clearly. Let's not merge anything yet though, because the current branch\n> tip is not passing (my doing, I'll fix it).\n>\n> D\n>\n> ________________________________\n> Derek Kaknes\n>\n>\n> > On Mar 25, 2015, at 2:21 PM, robertsdwyer <notifications@github.com>\n> wrote:\n> >\n> > Yes I agree. That's what the parserSLH is doing. The output of all\n> parsers will be identical and can be used to initialize User as is\n> currently being done for parderSLH. So User is agnostic to incoming data.\n> >\n> > Sent from my iPhone\n> >\n> > > On Mar 25, 2015, at 2:16 PM, Derek Kaknes <notifications@github.com>\n> wrote:\n> > >\n> > > Let me outline my thoughts a little more clearly:\n> > >\n> > > I think we should structure the application so that the models (User,\n> Portfolio, Loan, Lender, Criteria) are completely agnostic to the form of\n> data the application is receiving, ie they should perform no parsing or\n> cleaning functions. The code should be written so that these models are\n> looking for specific mandatory inputs and if those inputs are not received\n> or are received in unrecognized formats, then the model should raise\n> Exception that indicates what the missing data point was and what the\n> required format should be. Then, it should be the job of the upstream\n> parsers to input data (in whatever format) and return a data structure that\n> maps perfectly to the model's interface. Thus, if we want to add an\n> additional data source, then we just add a new parser that converts the\n> incoming data feed into a structure that will be accepted by all the models\n> and (importantly) we will never have to make changes to the models just to\n> accommodate a new or different d ata sour ce.\n> > >\n> > > —\n> > > Reply to this email directly or view it on GitHub.\n> > >\n> > —\n> > Reply to this email directly or view it on GitHub.\n> >\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/robertsdwyer/PSLv3/pull/1#issuecomment-86166331>.\n>\n"}}