Python library

Tagged: 

  • This topic has 2 replies, 3 voices, and was last updated 4 years ago by jeffrey hess.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3290
    richard
    Participant

      We do have a general interest in a python library for datagraph. We generate multiple, linked datasets from different sources and put them into datagraph at the moment. Using ‘masks’ to filter the data for particular subsets is already nice, but somewhat limited sometimes. We are exploring ‘glue’ as a python GUI specifically made to link datasets of different types to one another. Subset selection by functions is easily possible and so on. Still, being able to plot the extracted/analyzed/filtered data directly by calling datagraph from python would be great!

      #3292
      david
      Moderator

        There is a way to call DataGraph from python by using the dgraphconnect command.  This is a command that is included inside the DataGraph wrapper (Contents/Library/), next to the dgraph command line utility.  The dgraphconnect command connects to a running instance of DataGraph.  You can’t use it to poke around in a file that is already open, but you can open a file, add/remove data and commands etc.  You can still interact with it using the GUI which can lead to interesting effects.  The simplest way to get started is to launch DataGraph, go into the directory in the terminal and do

        ./dgraphconnect

        That will initiate the connection.  Then write a command it doesn’t understand like

        help

        and up pops the debugging/help window.

        You can then reconnect, so in python you can use a command line call to dgraphconnect and it remembers what file you connected to between calls.

         

        Here is another potential way:

        For R there is a DataGraph package on CRAN that allows you to save dataframes and have DataGraph automatically notice that a data file was written or appended and incorporate the data automatically, redrawing anything that depends on that.  And that is without interrupting the execution.  This comes with code, and uses DTSource, a library that is part of DataTank, another application that I’ve made.  I also have a Julia library to do the same, but I haven’t created a python library for it.  The source to write the data file is all readily available in C++.  I created the Julia library because I was interested in learning Julia.

        Third option, but this is a hard hat area.  I am working on yet another application – ImageTank, and that can call python from within the application.  Even though it is mostly focused on images it is intended to not just visualize them but also analyze and allow you to run your own codes.  Think of it as Jupyter on steriods.  This is under development, but I am looking for use cases and you can download it.  In fact, if you have a DataGraph license it will work without any registration.  My current use cases are in exploring 3D images.  I’ve added support for data Tables and include filtering that is very similar to DataGraph.

        Of course DataTank is there, but it doesn’t have a lot of support for tables and is mostly focused on spatial and temporal data, mainly from large simulations (think stochastic, fluids, simulations).

        David

        #3758
        jeffrey hess
        Participant

          I just ran across this topic and it peaked my interest.  I spent the last couple of months teaching myself python in order to perform principal component analysis on geochemical data I collected during an environmental investigation a couple of years ago.  I was never able to generate acceptable graphics in python, so I exported the results into csv and imported into DataGraph, which produced some really nice graphs of the results.

          I am using a Jupyter notebook to document the process and run the code.  Is it possible to incorporate DataGraph into the workflow so it is called from python and have it output the graphs back into the Jupyter notebook?

          If so, this seems like an interesting project for the coming months.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.