deepmodeling / deepmodeling/tbplas

[Code scan] Make plot_wfc3d default rn_max integral

Open Beginner friendly
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
19
Forks
6
PR merge metrics
No merged PRs in 30d

Description

This issue comes from a Codex global scan of deepmodeling/tbplas at commit 4d3652b3dba8eb930e4869a6d41074f62d703692.

Severity: Medium

When `rn_max` is omitted, `plot_wfc3d()` sets it to `np.zeros(3)`, which is a float array. The next comprehension passes those float values to `range()`, so the default call path raises `TypeError` before any cube data can be generated.

Code reference:
https://github.com/deepmodeling/tbplas/blob/4d3652b3dba8eb930e4869a6d41074f62d703692/tbplas/visual.py#L505-L510

Suggested fix: create `rn_max` with an integer dtype and normalize user-provided values with `np.array(rn_max, dtype=np.int64)` before using them in `range()`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in tbplas/visual.py around lines 505-510 and inspect how plot_wfc3d() builds the default rn_max and passes its values to range(). Verify that the omitted-rn_max path no longer raises TypeError before cube data generation, and that user-provided values are accepted by the same path.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.