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

Fix failing tests on 32-bit #150

Merged
merged 3 commits into from
May 8, 2023
Merged

Fix failing tests on 32-bit #150

merged 3 commits into from
May 8, 2023

Conversation

nileshpatra
Copy link
Contributor

At many places results are typecasted into plain ints this chokes on 32 bit archs with:

_______________________________ test_complement ________________________________
    def test_complement():
        ### complementing a df with no intervals in chrX by a view with chrX should return entire chrX region
        df1 = pd.DataFrame(
            [["chr1", 1, 5], ["chr1", 3, 8], ["chr1", 8, 10], ["chr1", 12, 14]],
            columns=["chrom", "start", "end"],
....
>       pd.testing.assert_frame_equal(
            bioframe.complement(df1, view_df=df1_chromsizes), df1_complement
        )
E       AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="start") are different
E       
E       Attribute "dtype" are different
E       [left]:  int32
E       [right]: int64

________________________________ test_subtract _________________________________
    def test_subtract():
        ### no intervals should be left after self-subtraction
        df1 = pd.DataFrame(
....
E       AssertionError: DataFrame are different
E       
E       DataFrame shape mismatch
E       [left]:  (2, 4)
E       [right]: (1, 4)
tests/test_ops.py:1131: AssertionError

This PR is an attempt to fix the same. Tested this, and it gets the tests green on 32-bit (i386) arch.

@nileshpatra
Copy link
Contributor Author

nileshpatra commented May 7, 2023

The CI failure is unrelated to my changes but happens because of changes in readthedocs itself, see

I have added fixes for the CI as well, and also added the links to commit message (long) description.

(edit: corrected the first link)

@nvictus nvictus merged commit 78dad55 into open2c:main May 8, 2023
@nvictus
Copy link
Member

nvictus commented May 8, 2023

Thank you, @nileshpatra !

@nileshpatra nileshpatra deleted the 32-bit branch May 8, 2023 18:35
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.

3 participants