num_regression outputs garbage to its file if arrays are of different size
See original GitHub issueIf you write arrays of different sizes on the data dict
, num_regression
fills the missing positions with garbage (or at least it seems garbage):
def testNumRegression(num_regression):
data = {}
for index in range(4):
data[f'data_{index}'] = np.array([index])
data['other'] = np.array([10, 20, 30, 40, 50, 60])
num_regression.check(data)
Output:
,data_0,data_1,data_2,data_3,other
0,0,1,2,3,10
1,-2147483648,-2147483648,-2147483648,-2147483648,20
2,-2147483648,-2147483648,-2147483648,-2147483648,30
3,-2147483648,-2147483648,-2147483648,-2147483648,40
4,-2147483648,-2147483648,-2147483648,-2147483648,50
5,-2147483648,-2147483648,-2147483648,-2147483648,60
Output converted to a markdown table so it’s easier to visualize:
data_0 | data_1 | data_2 | data_3 | other | |
---|---|---|---|---|---|
0 | 0 | 1 | 2 | 3 | 10 |
1 | -2147483648 | -2147483648 | -2147483648 | -2147483648 | 20 |
2 | -2147483648 | -2147483648 | -2147483648 | -2147483648 | 30 |
3 | -2147483648 | -2147483648 | -2147483648 | -2147483648 | 40 |
4 | -2147483648 | -2147483648 | -2147483648 | -2147483648 | 50 |
5 | -2147483648 | -2147483648 | -2147483648 | -2147483648 | 60 |
I can think of some ways of solving this:
- Raise an error suggesting that the user write the output on different files because the arrays have different sizes.
- Separate it in two tables, but I don’t know how difficult would be for
num_regression
to process multiple tables on the same file. - Fill the missing items with the space character.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
C++ array of fixed size getting garbage values - Stack Overflow
Another approach would be to only assign the NULL terminator to the last cell of your string, like a[s.length()] = '\0'; .
Read more >Change Your Container Size - Utilities - Seattle.gov
As a current Seattle Public Utilities customer, you can change the container sizes for your garbage, recycling, and food and yard (compost) collection....
Read more >Garbage / Recycling | Bakersfield, CA - Official Website
Quick links. City of Bakersfield garbage and recycling services for residents and businesses are operated by the Public Works Department Solid Waste Division....
Read more >Great Pacific Garbage Patch | National Geographic Society
The Great Pacific Garbage Patch is a collection of marine debris in the North Pacific Ocean. Also known as the Pacific trash vortex,...
Read more >Request Trash, Recycling, or Yard Waste Services
We offer three different cart sizes (option below). You only pay when you use the cart. Keep in mind a smaller cart will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With respect to the flag
fill_different_shape_with_nan=True
, should we raise an error when the array type is notfloat
, and fill it withnan
when the array type isfloat
?Sounds good to me 😃