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

Refactor xjson library #1248

Open
litghost opened this issue Feb 19, 2020 · 0 comments
Open

Refactor xjson library #1248

litghost opened this issue Feb 19, 2020 · 0 comments

Comments

@litghost
Copy link
Contributor

Some latent issues found during review from #1237:

  • prjxray/xjson.py is poorly named. Should be renamed to something akin to sort_complex_data
  • prjxray.xjson.extract_numbers won't handle mixed formatting well. Example given was extract_numbers("A100") > extract_numbers("100B"), which generates error:
In [1]: (100, 't') > ('t', 100)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-d06ca7865f0c> in <module>()
----> 1 (100, 't') > ('t', 100)

TypeError: '>' not supported between instances of 'int' and 'str'
  • prjxray.xjson.extract_numbers and prjxray.xjson.sort could use some more unit tests, above example is a good one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant