Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra Spaces in BURCAT_THR.xml #27

Open
gh-wf opened this issue Oct 20, 2023 · 1 comment
Open

Extra Spaces in BURCAT_THR.xml #27

gh-wf opened this issue Oct 20, 2023 · 1 comment

Comments

@gh-wf
Copy link

gh-wf commented Oct 20, 2023

I noticed several extra spaces in various elements. Two examples include:

N2 REF ELEMENT
H2 REF ELEMENT

Is there any specific reason for this, or can I fix the xml and propose to update it?

I noticed because I was getting an error from db.getelementdata using the string without the double space.

@ZGainsforth
Copy link
Collaborator

ZGainsforth commented Oct 20, 2023

Possibly, though it may be more optimal to make the code tolerant of multiple spaces in names. The BURCAT_THR.xml is downloaded directly (i.e. not modified or created by us) from the Burcat website: Burcat link. Thus, if we ever re-download a newer version, the spaces may creep back in. In addition, there may be spaces in some other phase names which we simply haven't found yet.

So a slick solution could be to do a regex on the user's input which converts all whitespace (\s+ or similar) to a single space, and then apply the same regex to the field read from the database. That solves this instance and any future whitespace instance.

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

No branches or pull requests

2 participants