Hi,
we don't usually send around notes after each dev-telecon, since
they can be found in the same link as the agenda, that I emailed
out just a few days ago:
https://docs.google.com/document/d/15JSFh3OMF9Iz6ov3q_xxGO_BL8hRnuse4IMUrqEIvcg/edit?usp=sharing
However, this time, we discussed a few items that might have an impact on how PRs are written and reviewed in the future (see link above for details):
- In Github, you can subscribe to the full astropy repro and get
an email notification for everything (which is a lot for core
astropy) or to individual issues/PRs. Some people would prefer
notification by sub-package (e.g. get an email for every PR that
changes a file in astropy/io/ascii). This can be done with a
CODEOWNERS file. William J will set that up for one case and if
you want to opt-in into this yourself, you can simply do a PR to
that file and add yourself for any subpackage you like. Note that
this file *could* also be used to require PR reviews by specific
people. WE WILL NOT DO THAT. Any maintainer can continue to merge
any PR in astropy, we only use the "subscribe to notification"
functionality (no PR yet).
- Codecov CI checks are sometimes spurious, e.g. a test is added, and that seems to decrease coverage and fail the CI. We agreed to lower the threshold (https://github.com/astropy/astropy/pull/13240 ) a bit and see if that helps.
- Formatting code can be contentious. Tom A is looking into using Black to autoformat and code touched in a PR using a pre-commit hook. Some people like it, some don't, but it would be useful to get some real live experience if that simplifies the experience of new or regular contributors or not. Ideally, we could activate this for some subpackage (e.g. io.ascii) and see how it goes before we decide on the next steps (no PR yet).
If you have any strong feelings or other good ides on these issues, this mailing list is a good place to discuss it; you might also try to attend the next dev telecon (2022-06-09, 14:00 UTC) and put it on the agenda for tht meeting again. (Same link as above).
Yours,
Moritz
On May 10, 2022, at 11:56, Moritz Guenther <moritz....@gmx.de> wrote:- Formatting code can be contentious. Tom A is looking into using Black to autoformat and code touched in a PR using a pre-commit hook. Some people like it, some don't, but it would be useful to get some real live experience if that simplifies the experience of new or regular contributors or not. Ideally, we could activate this for some subpackage (e.g. io.ascii) and see how it goes before we decide on the next steps (no PR yet).
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/B4FD10AC-6CB5-4B9A-AC2E-C32A96E50685%40gmail.com.
On May 10, 2022, at 15:01, Aldcroft, Tom <tald...@gmail.com> wrote:So maybe it is time to open the floodgates for discussion... :-)I brought this up at the dev meeting, and started by saying that even 2-3 years ago I looked at black-formatted code and didn't like it. But somewhere along the way it clicked and I realized that the style decisions that black has made are appealing to me. The general move to not-as-much on a single line is a good thing and improves readability. The lack of configurability also appeals to me so we don't need a separate big thread to decide on the defaults.
Numpy is having the same discussion (which is what got me inspired). There is a proof of concept for numpy. See https://mail.python.org/archives/list/numpy-di...@python.org/thread/WZTS3XZKKM3MKRPZ5XD6SHSREYLTQ3DC/ andhttps://github.com/numpy/numpy/pull/21449.On the numpy thread there was not actually that much dissent. I get the feeling a lot of projects are going this way.William Jamieson has volunteered to look into implementing something for astropy, possibly just doing auto-formatting on a per-subpackage basis. The key point is that this should happen locally when a developer makes a commit, so it is intended to be automatic and require no user effort. This will just be a proof-of-concept to make it easier to see how it might work in practice.If anyone would like to share on the developer experience, that would be good. In any case, this is your chance to weigh in with thoughts pro or con!
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAMtEP6z6RsUvbL5G_e72tne-5tqjZAs6DO%3D-sygFGriyMAHO2A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/49aa36f4b995302f2b814f1502d2459046497262.camel%40sconseil.fr.
I said it at the telecon and I am going to also say it here: Please leave astropy.io.fits out of this.
About line length, I was one of the original "give me 100 characters" people (as evidenced in time, io.ascii, table, but I've evolved and I'm happy with the black default recommendation of 88. From what I have seen the way black ends up splitting things the 88 characters works pretty well. I also have switched to using a laptop 100% of the time and so 88 actually helps me out a bit for fitting two files side by side with a reasonable font size.
My feeling is that black formats too much like a C programmer would -
especially with closing braces on their own line - and aims too much at
minimizing lines changed rather than optimizing for readability; I don't
feel it goes by the spirit of PEP8 even if it is formally compatible.
But obviously readability is subjective; I see the huge advantage of
just not having to discuss; and black seems to be the only option out
there. So, while I'm not really in favour, it is definitely not a big
enough deal to object beyond this e-mail!
Stuart
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/d351db37-ec06-4d66-2378-6e2e8c0876f7%40cadair.com.
Code formatted by Black tends to take up lots of vertical space, which is not quite to my liking, but I do recognize that it makes Git diffs less cluttered. So I would say we would be slightly trading off code readability for improved diff readability. I am in favor of applying Black with default settings (including 88 character line length) to all of astropy.
We already have more than two hundred commits in astropy main (a3c27114b964dd287f078c8d14cd10574ae4fba2) that explicitly mention PEP 8. That number is not going to get any smaller, but with Black it might stop growing.```shell$git log --grep="PEP\s*8" --pretty=oneline | wc -l
229```
Eero Vaher
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/01608250-1b39-4554-a4dd-b7db34c0f082n%40googlegroups.com.
On Tue, May 17, 2022 at 6:50 AM Stuart Mumford <stu...@cadair.com> wrote:
I will add that I am generally -1 on this, both from a personal
preference and also a practical standpoint. We seem to be getting on
perfectly fine without black most of the time, so I am not really sure
it's worth the disruption?
Fair point about effort vs. benefit. One of the benefits that has been cited by projects and individuals adopting black is freedom from having to consider PEP8 and think about style standards while writing code. This applies in particular to less-experienced developers. Most of the code that I see from my team members in the CXC is very much not PEP8-compliant and would require a lot of feedback (or an automated tool) to meet astropy standards.
Many of the more experienced people on this list most likely code in PEP8-compliant ways instinctively or apply auto-formatting in the editor. So "getting on perfectly fine" might not reflect the experience of everyone.
It might seem counterintuitive, but by telling contributors to run an additional one-time step to `pre-commit install` or `black .`, then we may be lowering the entry bar for contributing to astropy.
On 13 May 2022, at 10:37 pm, Simon Conseil <si...@sconseil.fr> wrote:
About tracing changes, just a note that it's possible to exclude some
commits for git-blame, e.g. for scikit-learn:
https://github.com/scikit-learn/scikit-learn/blob/main/.git-blame-ignore-revs
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/35DBAE98-75ED-43CA-9B69-D27E4D03128A%40gwdg.de.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAEUL7mHT51tcFz7JCdtJfuYu-4ABC6AAQdqq3gO0Bnn9Rh6Gmg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAEUL7mHT51tcFz7JCdtJfuYu-4ABC6AAQdqq3gO0Bnn9Rh6Gmg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAMtEP6zQ0YqcFsTdMK0aviYYnfwiENYwpwZ9t8uF__FqS28nMA%40mail.gmail.com.
I'm listening to this conversation from the sidelines and, at the moment, I'm pretty firmly neutral. There are good arguments both ways. I like making onboarding new users easier, though I'm not perfectly convinced yet that this change would achieve that. I'm very concerned about what a broad-strokes code style change does to blamability / history. My initial reaction was basically the same as Stuart's.I would caution against interpreting those contributing to this conversation as a voting quorum.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAEBNSwYaJX_fg1VPknQ%2BOwEQ2Y%3DZLTM7ffkf7Ls%2B-TKe0pU7Fw%40mail.gmail.com.
On May 17, 2022, at 05:25, Aldcroft, Tom <tald...@gmail.com> wrote:On Tue, May 17, 2022 at 6:50 AM Stuart Mumford <stu...@cadair.com> wrote:I will add that I am generally -1 on this, both from a personal
preference and also a practical standpoint. We seem to be getting on
perfectly fine without black most of the time, so I am not really sure
it's worth the disruption?Fair point about effort vs. benefit. One of the benefits that has been cited by projects and individuals adopting black is freedom from having to consider PEP8 and think about style standards while writing code. This applies in particular to less-experienced developers. Most of the code that I see from my team members in the CXC is very much not PEP8-compliant and would require a lot of feedback (or an automated tool) to meet astropy standards.Many of the more experienced people on this list most likely code in PEP8-compliant ways instinctively or apply auto-formatting in the editor. So "getting on perfectly fine" might not reflect the experience of everyone.
On May 17, 2022, at 05:25, Aldcroft, Tom <tald...@gmail.com> wrote:On Tue, May 17, 2022 at 6:50 AM Stuart Mumford <stu...@cadair.com> wrote:I will add that I am generally -1 on this, both from a personal
preference and also a practical standpoint. We seem to be getting on
perfectly fine without black most of the time, so I am not really sure
it's worth the disruption?Fair point about effort vs. benefit. One of the benefits that has been cited by projects and individuals adopting black is freedom from having to consider PEP8 and think about style standards while writing code. This applies in particular to less-experienced developers. Most of the code that I see from my team members in the CXC is very much not PEP8-compliant and would require a lot of feedback (or an automated tool) to meet astropy standards.Many of the more experienced people on this list most likely code in PEP8-compliant ways instinctively or apply auto-formatting in the editor. So "getting on perfectly fine" might not reflect the experience of everyone.As an experienced developer who codes in PEP8 instinctively at this point I am really happy with our switch to black at Rubin. I couldn’t see the point for a long while but now I know that I can write my almost PEP8 compliant code (especially when it comes to a line suddenly being longer than the limit) and know that I don’t have to spend the next few seconds sorting out where to wrap. I just run black (or wait for the pre-commit to trigger) and know that it will be fine.
Also, auto-formatting in an editor when black is not being used needs restraint. I’ve even had problems with astropy PRs where my editor will strip a trailing space from some other place in the file and I had to be careful to make sure I didn’t commit that when making my PR.—Tim Jenness
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/3AECBC0E-B0EF-495C-8657-A7E1AF7440C8%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/a804aaa0-750b-41b2-86a8-8e218988e229n%40googlegroups.com.
Hi all,A few follow-up thoughts:- It might be worth separating the question in a similar way to what the Django enhancement proposal did, which is (a) whether people are in favor of auto-formatters in general, and if so then (b) whether anyone has a better suggestion than black specifically?
- I would suggest not worrying for now about line lengths, as that is to some extent a detail that can be figured out if we do decide to go with black or another auto-formatter. If anything, it might make sense to assume for now we would just continue with the same line limit and then make the decision to change line lengths separately from the auto-formatting. Of course, we should make sure that decision is made before we actually implement any auto-formatting changes but it seems early to discuss it now.
- We are going to have to be careful about how this impacts backports to release branches - if we apply black to all the code in the core package in main but not in the release branches then backports are going to be much more complicated. If we do any significant reformatting (not just for PR diffs) then the best timing for that might be after feature freeze and before the next major release, because at that point there will be the least number of PRs open, the previous main release branch will no longer need backports, and the LTS version will already be 1 year old so the number of critical backports needed is going to be lower. In fact the ideal time would be after the 6.0 feature freeze when there are no longer any old active release branches, but that might be too long to wait.
- If there is agreement on using black or another auto-formatter, I think we should then have a dedicated call (or use one of the dev calls for that) to figure out some details (including timing and so on for release branches) before going ahead with implementing it or merging any PRs related to this.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAGMHX_3K_rG74KA-4bNwpOgD%3DJ_D8xn6tw%3DduDGmHYkPCYOSbQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/87k0ajvfnp.fsf%40weasel.astro.utoronto.ca.
Hi Marten,Reading this on my mobile phone I strangely found it a lot easier to understand what was going on in both equations in the black version, in particular with so many parentheses in the first case. The indents really help see which parentheses match. It made me realize that the equation for the numerator in the first case could in fact (and should!) be written as a one or two line loop which would be a lot clearer than either current or black formatting of the current equation!
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAGMHX_2mCFhw-oUTWOTYw%2Bgs4VOosYPwHKAP1YH2g3Q%2BX8VKhg%40mail.gmail.com.
r_core2 = r_core ** 2
a = r_core2 + r_tide ** 2
b = r_core2 + x ** 2
c = 1/np.sqrt(b) - 1/np.sqrt(a)
d = r_core/a ** (3/2) - r_core/b ** (3/2)
d_amplitude = r_core2 * c ** 2
d_r_core = 2 * amplitude * r_core2 * d * c + 2 * amplitude * r_core
* c ** 2
d_r_tide = (2 * amplitude * r_core2 * r_tide * c)/a ** (3/2)
(But it's probably possible to do something even better)
Simon
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/f2c2f8a2fc37ef0112bf391ac7d9f766dce0b0a1.camel%40sconseil.fr.
Thanks all for the answers. On balance, I now agree that the example I
sent is not one that ends up being a strong argument against black, and
possibly even in favour if it leads to code improvements.
But my main point really is that switching to black will actually
require work from all sub-package maintainers -- work that may well be
worth it long term, but for which time has to be found nonetheless.
Overall, count me in the neutral category (where all that's stopping me
from being actually positive is that black has all those lines with just
closing parentheses on them...).
-- Marten
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/y2j1qwr9cu3.fsf%40swan.astro.utoronto.ca.
Thanks all for the answers. On balance, I now agree that the example I
sent is not one that ends up being a strong argument against black, and
possibly even in favour if it leads to code improvements.
But my main point really is that switching to black will actually
require work from all sub-package maintainers -- work that may well be
worth it long term, but for which time has to be found nonetheless.
Overall, count me in the neutral category (where all that's stopping me
from being actually positive is that black has all those lines with just
closing parentheses on them...).
I do not have any data to answer that even by my personal metrics, so waiting to hearabout some real-world experience from Django and especially scikit-learn – thanks fortrying to collect that information, Tom!
Cheers,Derek
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/D43727CE-320A-4994-9FAA-4150A1F68E6D%40gwdg.de.
Hi,
I may have been neutral before, but this discussion (plus Derek's PR coming out of this!) have convinced me that black would beneficial for us.
Derek also seems convinced.
For Marten "all that's stopping me from being actually positive
is that black has all those lines with just liberally
closing parentheses on them", so maybe he could be convinced if
allowed to use "# fmt: off/on"
liberally
when encountering regions where that's a problem.
And I think Pey Lian never argued against black in general, only against using it on io.fits (I suggest to leave it to Simon and Pay Lian to agree on how to deal with that sub-package).
So, the only strong objections are Larry and maybe Erik.
To me that indicates that we reaching agreement without a vote.
Everyone had the chance to weigh in on a public mailing list (if
you are opposed to adopting black, but have not yet posted to this
thread, now might be a good time!) and there is mostly agreement
THAT using black is good, but the open points are implementation
details like the line length and the date of adoption. Or am I
missing something?
Moritz
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAMtEP6wx-dzkp1uHsHR%2B%3Ds%2BPrbW2ndQPv84aNOtt79wrZo0GLg%40mail.gmail.com.
I may have been neutral before, but this discussion (plus Derek's PR coming out of this!) have convinced me that black would beneficial for us.
Derek also seems convinced.
For Marten "all that's stopping me from being actually positive is that black has all those lines with just liberally
closing parentheses on them", so maybe he could be convinced if allowed to use"# fmt: off/on"
liberally when encountering regions where that's a problem.And I think Pey Lian never argued against black in general, only against using it on io.fits (I suggest to leave it to Simon and Pay Lian to agree on how to deal with that sub-package).
So, the only strong objections are Larry and maybe Erik.
To me that indicates that we reaching agreement without a vote. Everyone had the chance to weigh in on a public mailing list (if you are opposed to adopting black, but have not yet posted to this thread, now might be a good time!) and there is mostly agreement THAT using black is good, but the open points are implementation details like the line length and the date of adoption. Or am I missing something?
Hi -The astropy core is currently considering implementing code formatting with black, much as scikit-learn did in 2020 (https://github.com/scikit-learn/scikit-learn/pull/18948). Not surprisingly there are a wide range of opinions and concerns.My goal in writing is to request feedback from the scikit-learn community about how this transition has impacted development and community engagement in the time since the transition.Has there been specific feedback from contributors (both experienced and new) related to black autoformatting?
- Ease of actually running black and meeting the black-format standard for PRs. Have there been contributor problems that required assistance?
- Style considerations?
- Technical problems like backports?
Are there any regrets or things you would change?
_______________________________________________Do you have any advice for the astropy project?Any feedback from your experience would be most appreciated, especially coming from a more science-oriented project like scikit-learn (as opposed to other large projects like django or pytest that have also adopted black).Cheers,Tom (@taldcroft on GitHub)
scikit-learn mailing list
scikit...@python.org
https://mail.python.org/mailman/listinfo/scikit-learn
- Black code should be autopep8 compatible, so it will pass CI. If we
agree that black formatted code is generally acceptable, then any
developer can choose to apply black FOR ANY NEW CODE if they wish.
That's close to what we do already; I'm not aware of a PR that was
turned down because someone formatted it with black.
- We already have style differences (e.g. line length) between different
sub-packages. If io.ascii is different from io.fits today anyway, maybe
io.ascii could be black formatted - it would still be different from
io.fits, just in a different way than today; maybe not ideal, but also
not much different than the current status. With that, sub-package
maintainers who like black might run their sub-packages through black at
a convenient time (when it does not mess up backports). In many
sub-packages a large fraction of PRs is done by few people, who often
are also the maintainers. If, e.g., the io.ascii maintainers agree on
black, run io.ascii through black, and use black locally for all of
their own PRs, then they get almost all the benefits of black - they
don't have to think about formatting and the formatting in the
sub-package is consistent. If there are PRs that don't follow black the
maintainers could ask if the submitter is willing to run black over it
for consistency, or add a commit just before merging themselves that
does that, or just accept that there are a few lines or functions that
are not black formatted, until running black again over the entire
module at some point in the future(e.g. for the 8.0 release).
--
You received this message because you are subscribed to the Google Groups "astropy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astropy-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astropy-dev/CAMtEP6zeq_hqbgNpK2FzcVini0Tbn%3DC809toQRGBy-Pz1mN_5w%40mail.gmail.com.