array / data type compatibility issues after env upgrade
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
This line above produces:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
When trying to run the CHX profile function E_scan() regardless of the the inputs to this scan (a list of energies).
Locally testing shows you can make the following changes to just this one line, and things will work:
res = list(np.array([theta]), np.array(ds), np.array(I_list))[0]
hot fix solved by making this change to a temporary version pasted into the namesapce and overwriting xf.get_Bragg()
Scan goes (profile function E_scan()) and the resulting plot looks qualitatively correct.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at chxtools/xfuncs.py around line 390, where get_Bragg() is used by the E_scan() profile function and produces the NumPy shape error. Reproduce the failure with a list of scan energies, inspect the array construction there, and verify the fix by running E_scan() and confirming that the resulting plot is qualitatively correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100