Repository navigation
Make astropy.utils.decorators.wraps much more like functools.wraps - #7554
Conversation
|
Check results are now reported in the status checks at the bottom of this page. |
|
It's also worth noting, that there is only one other use of |
|
It appears there is one quirk with |
|
Ok so just to be clear, |
|
@astrofrog Yes, but not quite with perfect feature parity. |
Looks like a "catch 22" situation. I am not convinced until tests can pass. 😉 |
|
haha, the question is, are we willing to loose the |
|
I cannot comment on the |
|
I’m gong to be offline for the next week, can look when I’m back |
|
Very much in favour from the peanut gallery! Though since it is actually in the documentation, I think |
|
I didn't find a single place on github where this was used, so we most probably can get away with @mhvk's suggestion for a very quick deprecation period. |
|
@bsipocz did you also check for |
|
@Cadair - There is minimal use for that, and most of the hits seems to be in copies of astropy itself: https://github.com/search?q=make_function_with_signature&type=Code I've only found one genuine use of it in one of Perry's repos, so my guess is the usage is indeed fairly low. |
|
I like it - provided we don't completely break |
|
Too controversial to merge so close to freeze time, so re-milestoned. 😬 |
|
I think this is one for the meeting in Dec. |
OK, added to breakout planning board. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
OK, added "keep open". I think there was general consensus that this was a good idea as long as |
|
@Cadair - Could you please rather rebase this that keeping it alive by the label? IMO we shouldn't over use the label otherwise easily end up it the previous situation of having long abandoned PRs all over. |
e756e93 to
8061a16
Compare
Codecov Report
@@ Coverage Diff @@
## master #7554 +/- ##
==========================================
+ Coverage 86.9% 86.93% +0.02%
==========================================
Files 393 397 +4
Lines 58584 59123 +539
Branches 1064 1100 +36
==========================================
+ Hits 50914 51397 +483
- Misses 7051 7085 +34
- Partials 619 641 +22
Continue to review full report at Codecov.
|
|
Waiting to see if doc issue still occurs. It does not locally (though I'm seeing an error in an unrelated part of the docs) |
|
Doc still failed. FYI |
…rovided only for compatibility
Yeah, still can't reproduce locally, which is making it hard to troubleshoot.... |
….wraps is just functools.wraps)
|
OK, reproduced and fixed (hopefully). The other changes in the last push were to replace imports of |
|
Awesome!! Thanks @mwcraig |
|
Since the deprecation from this PR has been reverted in #8624, I'm adding the |
|
For the sake of the exercise I'm looking at recent benchmark regressions and weirdly this came up as a reason for a 1.3-1.5x slowdown in the convolution benchmarks. |
|
Hmm... Do you think this is because it is using astropy/astropy/modeling/core.py Line 385 in 7a81d70 |
|
Yes, I think it's modeling related, but the regression should have show up in the deprecating PR if it's because of that. I suspect just there are some overheads here that we didn't think about, and/or some non optimal usage of modeling in convolution. I would say that we need to keep an eye on those benchmarks after the refactoring PR is merged in. Or, do you @astrofrog think that we can run the benchmarks on the PR to check the performance implications? (though either way the refactoring will be merge, so maybe it's not urgent to check it in the PR stage). |
since astropy wraps was removed in astropy#7554
Here is a controversial fix to #7551. This removes two features of
astropy.utils.decorators.wrapstheexclude_argsmethod and the way it overwrote the functions name.In return for this, we make use of the new
__signature__attribute in Python 3 and we probably don't need a lot more code that I have currently deleted in here.It seems that the only place astropy was using
exclude_argswas in the test runner, which is now irrelevant as my changes to that mean it generates the documentation automatically anyway. And my opinion on the name thing is that it's deeply horrific and probably never should have been done in the first place 😉