Git Product home page Git Product logo

Comments (3)

slabasan avatar slabasan commented on May 26, 2024

Hi @jgphpc,

Welcome to Hatchet! You are using cali-query in the correct way. The tree API by default assumes that an index called time exists in the dataframe, but for caliper, the time column really depends on what the user has specified in the query.

In your example, you actually have 2 different time-related columns to choose from. So rather than renaming a column in your dataframe, you can change the metric parameter in the tree API:
print(gf.tree(metric="inclusive#sum#time.duration"))
and
print(gf.tree(metric="sum#sum#time.duration"))

Hope this helps, and let us know if you have any more questions.

from hatchet.

jgphpc avatar jgphpc commented on May 26, 2024

This is amazing 👍 thank you

gf.dataframe.columns

Index(['time (inc)', 'sum#sum#time.duration', 'nid', 'name'], dtype='object')

print(gf.tree(metric="sum#sum#time.duration"))

0.025 main
├─ 0.000 TimeIncrement
└─ 0.000 LagrangeLeapFrog
   ├─ 0.012 LagrangeNodal
   │  └─ 0.002 CalcForceForNodes
   │     └─ 0.002 CalcVolumeForceForElems
   │        ├─ 0.057 IntegrateStressForElems
   │        └─ 0.060 CalcHourglassControlForElems
   │           └─ 0.081 CalcFBHourglassForceForElems
   ├─ 0.001 LagrangeElements
   │  ├─ 0.003 CalcLagrangeElements
   │  │  └─ 0.056 CalcKinematicsForElems
   │  ├─ 0.032 CalcQForElems
   │  │  └─ 0.014 CalcMonotonicQForElems
   │  └─ 0.002 ApplyMaterialPropertiesForElems
   │     └─ 0.045 EvalEOSForElems
   │        └─ 0.096 CalcEnergyForElems
   └─ 0.005 CalcTimeConstraintsForElems

print(gf.tree(metric="time (inc)"))

0.492 main
├─ 0.000 TimeIncrement
└─ 0.467 LagrangeLeapFrog
   ├─ 0.213 LagrangeNodal
   │  └─ 0.201 CalcForceForNodes
   │     └─ 0.199 CalcVolumeForceForElems
   │        ├─ 0.057 IntegrateStressForElems
   │        └─ 0.140 CalcHourglassControlForElems
   │           └─ 0.081 CalcFBHourglassForceForElems
   ├─ 0.249 LagrangeElements
   │  ├─ 0.059 CalcLagrangeElements
   │  │  └─ 0.056 CalcKinematicsForElems
   │  ├─ 0.046 CalcQForElems
   │  │  └─ 0.014 CalcMonotonicQForElems
   │  └─ 0.143 ApplyMaterialPropertiesForElems
   │     └─ 0.141 EvalEOSForElems
   │        └─ 0.096 CalcEnergyForElems
   └─ 0.005 CalcTimeConstraintsForElems

from hatchet.

slabasan avatar slabasan commented on May 26, 2024

Looks great!! Other things you can do with the tree API are specifying colors (color=True), change precision (precision=2), and specify particular ranks/threads (rank=1, thread=0). We're also working on adding a depth parameter to the tree, so you can opt to print a certain number of levels of the tree if your tree has many levels.

from hatchet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.