From z.baratz at gmail.com Wed Dec 28 14:10:50 2022 From: z.baratz at gmail.com (Zvi Baratz) Date: Wed, 28 Dec 2022 21:10:50 +0200 Subject: [Neuroimaging] Integrating code formatting in NiBabel Message-ID: Hi all, I'm wondering what's the general feeling towards integrating code formatting (e.g., black ) into NiBabel's dev dependencies? Seems like formatters have become relatively standard in modern libraries, and personally, I do feel they help reduce cognitive load both in writing and in reviewing code. I'd be happy to hear your thoughts. All the best, Zvi -------------- next part -------------- An HTML attachment was scrubbed... URL: From markiewicz at stanford.edu Wed Dec 28 15:12:09 2022 From: markiewicz at stanford.edu (Christopher Markiewicz) Date: Wed, 28 Dec 2022 20:12:09 +0000 Subject: [Neuroimaging] Integrating code formatting in NiBabel In-Reply-To: References: Message-ID: Hi Zvi, I agree we should switch to auto-formatting. I started on a PR a while back to switch to using blue and isort: https://github.com/nipy/nibabel/pull/1124 There are a couple issues I have with black that I hoped to resolve with blue, but the larger one is in limbo (which is why 1124 stalled): https://github.com/grantjenks/blue/pull/83 The lesser one is that I prefer single quotes. If others feel strongly about black, I'm okay losing that argument here as in so many other places. The main thing that I would insist on is that chunks of code that are more understandable in a tabular format than a tree format need to be protected from the formatter. Happy to continue the discussion here or on GitHub. Best, Chris ________________________________ From: Neuroimaging on behalf of Zvi Baratz Sent: Wednesday, December 28, 2022 14:10 To: Neuroimaging analysis in Python Subject: [Neuroimaging] Integrating code formatting in NiBabel Hi all, I'm wondering what's the general feeling towards integrating code formatting (e.g., black) into NiBabel's dev dependencies? Seems like formatters have become relatively standard in modern libraries, and personally, I do feel they help reduce cognitive load both in writing and in reviewing code. I'd be happy to hear your thoughts. All the best, Zvi -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at lis.ac.uk Wed Dec 28 18:14:26 2022 From: matthew.brett at lis.ac.uk (Matthew Brett) Date: Wed, 28 Dec 2022 23:14:26 +0000 Subject: [Neuroimaging] Integrating code formatting in NiBabel In-Reply-To: References: Message-ID: Hi, On Wed, Dec 28, 2022 at 9:11 PM Christopher Markiewicz wrote: > > Hi Zvi, > > I agree we should switch to auto-formatting. I started on a PR a while back to switch to using blue and isort: https://github.com/nipy/nibabel/pull/1124 > > There are a couple issues I have with black that I hoped to resolve with blue, but the larger one is in limbo (which is why 1124 stalled): https://github.com/grantjenks/blue/pull/83 > > The lesser one is that I prefer single quotes. If others feel strongly about black, I'm okay losing that argument here as in so many other places. The main thing that I would insist on is that chunks of code that are more understandable in a tabular format than a tree format need to be protected from the formatter. > > Happy to continue the discussion here or on GitHub. Only to note that Astropy recently committed itself to using Black, after a fairly long discussion and an Astropy Proposal for Enhancement: https://github.com/astropy/astropy-APEs/blob/main/APE20.rst https://docs.astropy.org/en/latest/development/codeguide.html#coding-style-conventions I also find I prefer single-quoted strings, for some reason, but - probably like Chris - I don't feel strongly about it. Cheers, Matthew From z.baratz at gmail.com Thu Dec 29 02:12:49 2022 From: z.baratz at gmail.com (Zvi Baratz) Date: Thu, 29 Dec 2022 09:12:49 +0200 Subject: [Neuroimaging] Integrating code formatting in NiBabel In-Reply-To: References: Message-ID: Hi, I do generally prefer double-quotes, but I am happy to conform with whatever. The main thing for me as having something consistent that can be applied automatically. Let's continue on GitHub. Thank you, Zvi On Thu, Dec 29, 2022 at 1:15 AM Matthew Brett wrote: > Hi, > > On Wed, Dec 28, 2022 at 9:11 PM Christopher Markiewicz > wrote: > > > > Hi Zvi, > > > > I agree we should switch to auto-formatting. I started on a PR a while > back to switch to using blue and isort: > https://github.com/nipy/nibabel/pull/1124 > > > > There are a couple issues I have with black that I hoped to resolve with > blue, but the larger one is in limbo (which is why 1124 stalled): > https://github.com/grantjenks/blue/pull/83 > > > > The lesser one is that I prefer single quotes. If others feel strongly > about black, I'm okay losing that argument here as in so many other places. > The main thing that I would insist on is that chunks of code that are more > understandable in a tabular format than a tree format need to be protected > from the formatter. > > > > Happy to continue the discussion here or on GitHub. > > Only to note that Astropy recently committed itself to using Black, > after a fairly long discussion and an Astropy Proposal for > Enhancement: > > https://github.com/astropy/astropy-APEs/blob/main/APE20.rst > > > https://docs.astropy.org/en/latest/development/codeguide.html#coding-style-conventions > > I also find I prefer single-quoted strings, for some reason, but - > probably like Chris - I don't feel strongly about it. > > Cheers, > > Matthew > _______________________________________________ > Neuroimaging mailing list > Neuroimaging at python.org > https://mail.python.org/mailman/listinfo/neuroimaging > -------------- next part -------------- An HTML attachment was scrubbed... URL: