I’m relatively new to Python.
The problem I have is that the way rdsr_navigator is written, if there are multiple instances of a field (x-ray filters for example, in the attached image); then rdsr_navigator grabs the first instance found. I am only interested in the copper filtration figures and not aluminium, which on some systems comes up as the first instance, and on others the second.
I have tried several things, but nothing is a great solution or works as intended and I don’t expect them to given I really am just clutching at straws.
To top it off, I’ve never worked with generators/iterators or object-oriented programming before. I have tried several things but it seems that where I’m running into grief is how the RDSR is turned into an object/structure in the first place.
If I use the iterator in reverse AND only in reverse, I can get the copper info. However, if I use it in conjunction with the regular iterator it still only finds the aluminium info. It seems that running the standard iterator creates the RDSR object/SrElement when the iterator is called the first time and it doesn’t get reconstructed in reverse when I call the reverse iterator… If that makes sense.
Could anyone with some know please assist me? Thanks. Much appreciated.
Example of duplicate instance for x-ray filters
JRP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.