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

Reorganise core #187

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

andrewgsavage
Copy link
Contributor

I am finding core.py difficult to work with as there is so much in the file.

I've moved it into it's own folder, then started moving parts to other files in a similar way to what I have seen in other python modules.
eg anything related to formatting to .core/formatting.py, same for parsing etc.

I'd also like to follow pint's Quantity restructuring which uses subclassing and has made it easier to work with. For example, AffineScalarFunc.__format__ is currently in core.py. __format__ could be moved to a class in formatting.py and AffineScalarFunc could inherit __format__ from that class.

What are people thought's on this approach?

@newville
Copy link
Member

@andrewgsavage I might suggest also inverting the use of UFloat as an alias for AffineScalarFunc. That is, I think the main interface and way of thinking of the basic object is as a UFloat, and the name "AffineScalarFunc" is slightly odd and confusing to see in exceptions.

@andrewgsavage
Copy link
Contributor Author

I agree, but I think that's worth doing in another PR to make this easier to review. AffineScalarFunc is refered to in many docstrings that would need changing too. Here I've only moved functions and classes into new files. I've got it to the point where the python 3.5 CI shows tests passing which looks as good as it can get.

I've a branch continuing from this where I've started using subclassing and getting numpy to work on scalars. Was hoping to get this one merged first.

@newville
Copy link
Member

@andrewgsavage I agree with all of that, and great to hear about the branch with continued work on arrays.

I'm still in favor of waiting until March 1 in hopes of getting a cleaner transition, but without any communication from @lebigot about this, it is not easy to be optimistic.

Would make sense to start working on lmfit/uncertainties or perhaps some other repo or maybe a wiki where design and priorities could be discussed?

@andrewgsavage
Copy link
Contributor Author

Yea waiting until March 1 is fine. I think it's easier to keep discussion in this repo for the time being as it keeps everything in the same place.

I think the maintaince issue is fine for disussing design and priorities. If I've got code ready I'll put it in a PR as for things like subclassing and numpy support it's a little easier to see it in code than describe.

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