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

Allow creating new .NET arrays from Python using Array[T](dim1, dim2,…) syntax #1291

Merged
merged 1 commit into from Nov 24, 2020

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Nov 24, 2020

What does this implement/fix? Explain your changes.

This handles a few new argument combinations in tp_new of .NET array types:

  1. A single integer to create a one-dimensional array of specified size.
  2. Multiple integers passed as arguments (e.g. Array[T](3,5,7)) to create a multidimensional array.

It processes all exceptions specified in https://docs.microsoft.com/en-us/dotnet/api/system.array.createinstance?view=net-5.0#System_Array_CreateInstance_System_Type_System_Int64___

Does this close any currently open issues?

fixes #251

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@codecov-io
Copy link

codecov-io commented Nov 24, 2020

Codecov Report

Merging #1291 (1d17421) into master (c81c3c3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1291   +/-   ##
=======================================
  Coverage   87.97%   87.97%           
=======================================
  Files           1        1           
  Lines         291      291           
=======================================
  Hits          256      256           
  Misses         35       35           
Flag Coverage Δ
setup_linux 65.29% <ø> (ø)
setup_windows 74.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c81c3c3...1d17421. Read the comment docs.

@lostmsu lostmsu requested a review from filmor November 24, 2020 21:11
@lostmsu lostmsu merged commit 182faed into pythonnet:master Nov 24, 2020
@lostmsu lostmsu deleted the features/ArrayFromShape branch November 24, 2020 22:08
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.

Array instantiation does not work with clean syntax
3 participants