Comments (3)
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.
This is amazing
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.
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)
- Multiprocessing is Experiencing Deadlocks in GraphFrame.filter HOT 3
- Multiprocess not installed with Hatchet through Pip HOT 1
- Graph Literal Validator
- Elide collapsed subtrees with triangle icons [Roundtrip] HOT 1
- Pan/Zoom on Trees [Roundrip] HOT 1
- Draw Trees to Utilize more Vertical Space [Roundtrip] HOT 2
- Collapse Trees by Default [Roundtrip]
- Add "inplace" to hatchet operations HOT 1
- Add bivariate color map to roundtrip HOT 1
- Make Roundtrip Javascript Loading More Dynamic / Change Javascript Development Workflow HOT 1
- Q: How to read in traces generated by Caliper? HOT 4
- Add a Reader for ROCProfiler HOT 2
- Hatchet multi-process problem when handling large graphs HOT 8
- build error for Python 3.9 HOT 1
- feature request: subtree aggregate, graphframe subtree HOT 4
- import multiprocess as mp HOT 8
- bug in cprofile reader
- Support for Perfetto Trace Format HOT 1
- Filter/squash error on HPCToolkit database: `AttributeError: 'int' object has no attribute '_hatchet_nid'` HOT 2
- build failure on python 3.11, longintrepr.h not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hatchet.