Skip to content

Conversation

@nicole-brewer
Copy link
Contributor

Added a _ipython_display_ method to the Node class so that nodes are displayed automagically in Jupyter as follows:

from chi import hardware

nodes = hardware.get_nodes()
node = nodes[0]
node

@nicole-brewer
Copy link
Contributor Author

Screenshot 2025-06-17 at 10 33 51 AM

Copy link
Contributor

@Mark-Powers Mark-Powers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but could you improve the error handling as mentioned below?

chi/hardware.py Outdated
HTML(f"<b>Type:</b> {self.type}", style=style, layout=layout),
HTML(f"<b>Clock Speed:</b> {self.cpu['clock_speed'] / 1e9:.2f} GHz", style=style, layout=layout),
HTML(f"<b>RAM:</b> {self.main_memory['humanized_ram_size']}", style=style, layout=layout),
HTML(f"<b>GPU Model:</b> {self.gpu['gpu_model'] or 'None'}", style=style, layout=layout),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for me when I use an openrc file from TACC, since not all nodes at TACC have gpu_model and gpu_count set.

Could you update the error handling to better support this? I think something like self.gpu.get("gpu_count", 0) would be good to default to 0. And if gpu_count == 0, don't include gpu_model in the display.

@Mark-Powers Mark-Powers removed the request for review from msherman64 June 18, 2025 14:17
@Mark-Powers Mark-Powers merged commit 1ca49d0 into ChameleonCloud:master Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants