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

FIX: tdb: Update float parsing regex #144

Merged
merged 3 commits into from Nov 12, 2017
Merged

FIX: tdb: Update float parsing regex #144

merged 3 commits into from Nov 12, 2017

Conversation

richardotis
Copy link
Collaborator

FIX: tdb: Update float parsing regex to detect floats with no trailing digits. Fixes gh-143.

Copy link
Collaborator

@bocklund bocklund left a comment

Choose a reason for hiding this comment

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

This will not treat leading 0s (e.g. 00.1 or 01.0) as floats, but instead as just match 0. If you parse the unmatched strings using float('00.1') it is parsed to 0.1 as you would expect and indeed Python seems to ignore leading zeros in numbers.

@richardotis
Copy link
Collaborator Author

Useful site for testing: https://regex101.com/

@bocklund bocklund merged commit 7f6e952 into develop Nov 12, 2017
@richardotis
Copy link
Collaborator Author

I think this change caused a 5-10% performance regression in creating Database objects. I'm not sure if it matters that much.

@richardotis
Copy link
Collaborator Author

Never mind, I'm getting a lot of scatter in my local unit testing. I think we're fine.

richardotis added a commit that referenced this pull request Nov 26, 2017
* FIX: tdb: Update float parsing regex to detect floats with no trailing digits. Fixes gh-143.

* FIX/WIP: tdb: Float parsing regex with lookaround

* WIP: tdb: Simplify negative lookahea for float parsing regex
@richardotis richardotis deleted the fix_143 branch November 14, 2018 23:54
bocklund added a commit to bocklund/pycalphad that referenced this pull request Aug 17, 2021
This syncs the last PR up with the `environment.yml` files from pycalphad#143. They are also now in sync with the conda-forge recipe.
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.

None yet

2 participants