!cANztuGawRmRSdyLhu:matrix.org

cl-ana

14 Members
Support for cl-ana, a Common Lisp data analysis library3 Servers

Load older messages


SenderMessageTime
17 May 2019
@ghollisjr:matrix.orgghollisjr table-get-field doesn't know about the logical fields 22:21:12
@katco:matrix.orgkatcowoohoo!22:21:12
@katco:matrix.orgkatcook, how can i best loop over the union of fields and logical fields?22:21:41
@ghollisjr:matrix.orgghollisjr The way to access logical fields is through (field :income-category) 22:21:44
@ghollisjr:matrix.orgghollisjrAh this is something more difficult, but still possible22:22:10
@ghollisjr:matrix.orgghollisjrThe logical-fields are stored in a hash-table22:22:21
@ghollisjr:matrix.orgghollisjr So long as you're using a define-res-macro definition, you could get these field symbols at compile time and then insert them into the code body 22:22:56
@ghollisjr:matrix.orgghollisjrThe way I've been working with fields due to needing information at compile time is to supply them to macros which define groups of targets that are related to each other22:24:01
@ghollisjr:matrix.orgghollisjr E.g., I might have some operator def-special-table and use it like (def-special-table (res src) (some list of fields) ... 22:24:53
@katco:matrix.orgkatcoi think for splitting functions i will always know the set of fields up front. i guess at that point it becomes a usability thing. it sounds like the code can discover the complete union of fields and so it should to make it more comfortable to use for the user22:25:22
@ghollisjr:matrix.orgghollisjrAh yes I agree22:25:39
@ghollisjr:matrix.orgghollisjr The variable storing the logical fields is cl-ana.makeres-table::*proj->tab->lfields* 22:26:25
@ghollisjr:matrix.orgghollisjr So you could get them like (gethash 'src (gethash (project) cl-ana.makeres-table::*proj->tab->lfields*)) if you want the lfields for src 22:27:33
@ghollisjr:matrix.orgghollisjrI believe they are encoded as an alist mapping from field symbol to the expression22:28:13
@katco:matrix.orgkatco tangential question: i noticed in most of your examples, DOP target names are tuples, e.g. (signal x-sigma). is there something special about that, or will 1 symbol, e.g. signal-x-sigma work just as well? 22:29:02
@ghollisjr:matrix.orgghollisjrAh this is just my style choice. It does make it easy to automatically generate target names though22:29:50
@ghollisjr:matrix.orgghollisjr E.g., if the table is (src), then I can apply some filter and call the result (src filter) 22:30:08
@ghollisjr:matrix.orgghollisjr Then any reductions associated with those tables could be ((src) mean x), ((src filter) mean x), etc. 22:30:53
@katco:matrix.orgkatcoi can see where you're coming from. it was slightly confusing to me, because even though i was pretty sure they were just names, i wasn't positive, and it looked like there might be some macro expansion or function calls going on22:32:04
@katco:matrix.orgkatco

especially this snippet:

(defres (branching src y-cut)
  (branch (res (branching y-cut-nsigmas))
          (ltab (res src)
              ()
            (when (funcall (res (branching y-cut))
                           (field x)
                           (field y))
              (push-fields)))))
22:32:30
@katco:matrix.orgkatco i stared at that funcall for a good long while XD 22:32:38
@ghollisjr:matrix.orgghollisjr😂 I don't think you are alone in that haha22:35:49
@ghollisjr:matrix.orgghollisjr I think that the branch operator is also one of the most confusing operators 22:36:40
@ghollisjr:matrix.orgghollisjr But since it was possible to provide a single symbol, branch, that would be able to perform multiple functions, I couldn't resist just using that one symbol 22:37:20
@katco:matrix.orgkatcoif i understand it correctly (and i can remember my linear algebra after years of dissuse), it's kind of like dot multiplication? i.e. it will perform operations for all branches in the graph?22:37:48
@ghollisjr:matrix.orgghollisjrYes it is very similar to that; I can't remember the official term for it but the term that comes to mind is "dumb parallelism"22:38:58
@ghollisjr:matrix.orgghollisjrI.e. it's purely parallel22:39:09
@katco:matrix.orgkatcooh! do you mean "embarassingly parallel"?22:39:24
@ghollisjr:matrix.orgghollisjrYes that's it!22:39:30
@ghollisjr:matrix.orgghollisjr:joy:22:39:40

Show newer messages


Back to Room ListRoom Version: 1