ANN: A new version (0.5.4) of python-gnupg has been released.

2025-01-07 Thread Vinay Sajip via Python-list
What Changed?=
This is an enhancement and bug-fix release, and all users are encouraged to 
upgrade.

Brief summary:

* Fix #242: Handle exceptions in the `on_data` callable.

 This release [2] has been signed with my code signing key:
Vinay Sajip (CODE SIGNING KEY) 
Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86

Recent changes to PyPI don't show the GPG signature with the download links.
An alternative download source where the signatures are available is at [4].
The source code repository is at [1].
Documentation is available at [5].

As always, your feedback is most welcome (especially bug reports [3],
patches and suggestions for improvement, or any other points via this group).

Enjoy!

Cheers

Vinay Sajip

[1] https://github.com/vsajip/python-gnupg
[2] https://pypi.org/project/python-gnupg/0.5.4
[3] https://github.com/vsajip/python-gnupg/issues
[4] https://github.com/vsajip/python-gnupg/releases/
[5] python-gnupg - A Python wrapper for GnuPG


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Add the numbers in a 9x9 multiplication Table

2025-01-07 Thread Kaz Kylheku via Python-list
On 2025-01-03, HenHanna  wrote:
> On Thu, 2 Jan 2025 10:54:02 +, yeti wrote:
>
>> https://oeis.org/A000537 ?
>
> Sum of first n cubes; or n-th triangular number squared.
>
> 0, 1, 9, 36, 100, 225, 441, 784, 1296, 2025, 3025, 4356, 6084, 8281,
> 11025, 14400, 18496, 23409, 29241, 36100, 44100, 53361, 64009, 76176,
> 9, 105625, 123201, 142884, 164836, 189225, 216225, 246016, 278784,
> 314721, 354025, 396900, 443556, 494209, 549081
>
>
>
> Thank you...It's not obvous to me why
>
> Sum of  (consecutive) cubes  would be a Square number.

Base case:

  1^3 is a square number.

Inductive hypothesis:

  Suppose that the sums of 1^3 through n^3 are a square number.
  What happens when we add (n+1)^3?

  In other words:

sum{1, n, n^3} = k * k  (for some positive integer k)

  What are we adding to this k * k?

(n+1)^3 = n^3 + 3n^2 + 3n + 1

  We have to show that adding this forumla to some k * k
  produces (k + m) * (k + m) for some positive integer m.

  When we take a k * k square and add m to the edges, we get
  k^2 + 2km + m^2.   In other words, the newly added area beyond the
  original k^2 consists of two k * m quadrangles and an m^2 square.

  Thus, it follows that the (n+1)^3 formula must be expressible in this
  form: 2km + m^2.

  Each successive cube must be adding area to a previous k*k square to
  make a larger square, by adding m to the edge, which results in an new
  additional area of 2km + m^2.  (Of course the k and m are different
  for each new cube.)

n^3 + 3n^2 + 3n + 1  =  m^2 + 2km

  For instance, 27 is equal to { k = 3, m = 3 } 3^2 + 2*3*3.

  On in the n = 7 case, 441 going to 784 (+ 343) we have { k = 21, m = 7 }:

343  = 7*7*7  =  7*7 + 2*21*7

  A pattern is emerging that m is the root of the cube; in
  other words that m = n + 1. Thus:

n^3 + 3n^2 + 3n + 1  =  (n+1)^2 + 2k(n + 1)

n^3 + 3n^2 + 3n + 1  =  n^2 + 2n + 1 + 2k(n + 1)

  Get k by itself:

n^3 + 2n^2 + 3n + 1  =  2n + 1 + 2k(n + 1)

n^3 + 2n^2 + n + 1   =  1 + 2k(n + 1)

n^3 + 2n^2 + n   =  2k(n + 1)

n^3 + 2n^2 + n   =  2k
--
n + 1


  We need to do long polynomial division to work out this
  fraction on the left:


   n^2  + n
   _
 n + 1 | n^3 + 2n^2 +  n + 0 
 n^2 + n^2
 --
   n^2  +  n + 0
   n^2  +  n
   -
   0 + 0

 
  This is the key: the division is exact!

2k  =   n^2 + n   = n(n + 1)

k = n(n + 1)/2

  which we know is an integer!

  So we know that each new cube (n+1)^3 is
  expressible in the form of:

m^2 + 2km

  if we identify k, m as:
  
 m = n + 1,and
 k = n(n + 1)/2 .

  What we have to show is that k is the correct square value.

  If k is the correct original square, then we have proved it;
  because k^2 + 2m is the correct quantity to take the k square
  to the k + m square.

  We could use a separate, parallel induction to prove this.

  Note that the formula k = n(n + 1)/2 is just the summation formula
  for consecutive integers from 1 to n. We can prove that
  the successive squares in the squares of these sums:
 
sum(1..1)^2 =  1
sum(1..2)^2 = 3^2  =   9
sum(1..3)^2 = 6^2  =  36
sum(1..4)^2 = 10^2 = 100

  So it's obvious by inspection that we have the correct k formula,
  and we can prove it more formally.

Conclusion:

  Since we have a base case, and true inductive hypothesis, the result
  holds for all n.

  The key insights are that
  
  1. the sequence values are the squares of consecutive integer sums;
 i.e. the squares of successive k-s, where k = n(n+1)/2.

  2. each cube value added to the previous sequence value
 is expressible in the form  m^2 + 2km,  which has the right
 shape to preserve the square property, and that with some
 algebra we can identify m as m = n + 1.


-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @kazina...@mstdn.ca
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: Happy 2025 with DIPY 1.10.0 💥

2025-01-07 Thread Eleftherios Garyfallidis via Python-list
Hello and Happy 2025 to all !,

We are excited to announce a new release of DIPY: DIPY 1.10.0 !

DIPY 1.10.0 (Friday, 12 December 2024)

The release 1.10.0 received contributions from 28 developers (the full
release notes are at:
https://docs.dipy.org/stable/release_notes/release1.10.html).

Thank you all for your contributions and feedback!

Please click here
 to
check 1.10.0 API changes.

Highlights of 1.10.0 release include:

- NF: Patch2Self3 - Memory less denoising for dMRI is now available.

- NF: Fiber density and spread from ODF using Bingham distributions method
added.

- NF: Iteratively reweighted least squares for robust fitting of diffusion
models added.

- NF: NDC - Neighboring DWI Correlation quality metric added.

- NF: DAM - DWI-based tissue classification method added.

- NF: New Parallel Backends (Ray, Joblib, Dask) for fitting reconstruction
methods added.

- RF: Deprecation of Tensorflow support. PyTorch support is now the default.

- Transition to Keyword-only arguments (PEP 3102).

- Zero-warnings policy (CIs, Compilation, doc generation) adopted.

- Adoption of ruff for automatic style enforcement.

- Transition to using f-strings.

- Citation system updated. It is more uniform and robust.

- Multiple Workflows updated.

- Multiple DIPY Horizon features updated.

- Large documentation update.

- Closed 258 issues and merged 187 pull requests.


To upgrade or install  DIPY

Run the following command in your terminal:


pip install --upgrade dipy

This version of DIPY depends on nibabel (3.0.0+).

For visualization you need FURY (0.12.0+).

Questions or suggestions?



For any questions go to https://dipy.org, or send an e-mail to
d...@python.org

We also have an instant messaging service and chat room available at
https://gitter.im/dipy/dipy

Finally, a new forum is available at
https://github.com/dipy/dipy/discussions

Have a wonderful time using the new version.

In addition, registration for the online DIPY workshop 2025 (March 17-21)
is open! The workshop will equip you with the skills and knowledge needed
to master the latest techniques and tools in structural and diffusion
imaging. See the exquisite program and keynote speakers here
. Register today to save a spot!

Please support us by citing DIPY in your papers using the following
DOI: 10.3389/fninf.2014.8



On behalf of the DIPY developers,

Eleftherios Garyfallidis, Ariel Rokem, Serge Koudoro

https://dipy.org/contributors
-- 
https://mail.python.org/mailman/listinfo/python-list