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

Compatibility with 32-bits CPU architectures #555

Merged
merged 2 commits into from Sep 21, 2022

Conversation

emollier
Copy link
Contributor

@emollier emollier commented Dec 5, 2020

Greetings,

While working on issue #520 related to migration to python 3.9 in the Debian project, I caught an issue specific to 32-bits CPU architectures. On 64-bits CPUs, the pandas.dtype returned for integers is a plain int 64 bits wide. However, on 32 bits machines, the type is returned as int64 to differenciate from plain int, which I suppose would be 32 bits wide in such context.

Due to this, when running the test suite on 32-bits CPU architectures, the error output includes several instances of errors such as the following:

======================================================================
ERROR: test_decode_numeric_value (qiime2.core.type.tests.test_primitive.TestMetadataColumn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/core/type/tests/test_primitive.py", line 66, in test_decode_numeric_value
    num_md = metadata.NumericMetadataColumn(value)
  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/metadata/metadata.py", line 875, in __init__
    raise TypeError(
TypeError: NumericMetadataColumn 'foo' does not support a pandas.Series object with dtype int64

Please note I did not know whether 32 bits support was under your radar or not, so in doubt I just leave that merge request for your convenience. I understand these limited architectures are usually a concern in bioinformatics, but I also heard of cases where architectures like armhf (which is 32 bits) were in use in various educational contexts.

Have a nice day, :)
Étienne.

On 64-bits CPUs, the pandas.dtype returned for integers is a plain
'int' 64 bits wide.  On 32-bits machines however, the type is returned
as 'int64' to differenciate from plain 'int', which is 32 bits wide in
such context.

When running the test suite on 32-bits CPU architectures, the error
output includes several instances of the following:

	======================================================================
	ERROR: test_artifacts_mismatch (qiime2.metadata.tests.test_metadata_column.TestEqualityOperators)
	----------------------------------------------------------------------
	Traceback (most recent call last):
	  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/metadata/tests/test_metadata_column.py", line 344, in test_artifacts_mismatch
	    mdc1 = DummyMetadataColumn(series)
	  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/metadata/metadata.py", line 875, in __init__
	    raise TypeError(
	TypeError: DummyMetadataColumn 'col1' does not support a pandas.Series object with dtype int64

This commit ought to enable the 'int64' type for the class of the test
suite DummyMetadataColumn.
On 64-bits CPUs, the pandas.dtype returned for integers is a plain
'int' 64 bits wide.  On 32-bits machines however, the type is returned
as 'int64' to differenciate from plain 'int', which is 32 bits wide in
such context.

When running the test suite on 32-bits CPU architectures, the error
output includes several instances similar to:

	======================================================================
	ERROR: test_decode_numeric_value (qiime2.core.type.tests.test_primitive.TestMetadataColumn)
	----------------------------------------------------------------------
	Traceback (most recent call last):
	  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/core/type/tests/test_primitive.py", line 66, in test_decode_numeric_value
	    num_md = metadata.NumericMetadataColumn(value)
	  File "/tmp/autopkgtest-lxc.shmdvuw3/downtmp/autopkgtest_tmp/qiime2/metadata/metadata.py", line 875, in __init__
	    raise TypeError(
	TypeError: NumericMetadataColumn 'foo' does not support a pandas.Series object with dtype int64

This commit ought to enable the 'int64' type for the class
NumericMetadataColumn.
@lizgehret
Copy link
Member

@ebolyen any reason we should hold off merging this one?

@lizgehret lizgehret merged commit b0c6302 into qiime2:master Sep 21, 2022
@lizgehret lizgehret added this to In Review in 2022.11 via automation Sep 21, 2022
@lizgehret lizgehret self-requested a review October 10, 2022 21:53
@lizgehret lizgehret moved this from In Review to Changelog Needed in 2022.11 Oct 10, 2022
@lizgehret lizgehret moved this from Changelog Needed to Completed in 2022.11 Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2022.11
  
Completed
Development

Successfully merging this pull request may close these issues.

None yet

2 participants