limix / pandas-plink

PLINK reader for Python.
MIT License
78 stars 18 forks source link

replaced deprecated pandas lineterminator arg #31

Closed rborder closed 3 months ago

rborder commented 1 year ago

Newer versions of pandas (2+) cause _write_bim and _write_fam to fail. This change ('line_terminator' -> 'lineterminator' in calls to pandas.DataFrame.to_csv) works for both new and old pandas versions.

dbolser commented 9 months ago

Looks good to me

dbolser commented 9 months ago

Can you add a test to catch changes like this in future?

e.g.

def test_two():
    import os
    import tempfile

    from pandas_plink import get_data_folder, read_plink1_bin, write_plink1_bin

    tmp_path = tempfile.mkdtemp()
    filename = "chr11.bed"

    filename = os.path.join(get_data_folder(), filename)

    G = read_plink1_bin(filename, verbose=False)
    print(G)

    write_plink1_bin(G, f"{tmp_path}/sample1.bed")

if __name__ == "__main__":
    test_two()
rborder commented 9 months ago

Yeah, no problem. Importing the unittest module okay or keep it simpler?

On Tue, Dec 12, 2023 at 3:11 AM Dan Bolser @.***> wrote:

Can you add a test to catch changes like this in future?

e.g.

def test_two(): import os import tempfile

from pandas_plink import get_data_folder, read_plink1_bin, write_plink1_bin

tmp_path = tempfile.mkdtemp()
filename = "chr11.bed"

filename = os.path.join(get_data_folder(), filename)

G = read_plink1_bin(filename, verbose=False)
print(G)

write_plink1_bin(G, f"{tmp_path}/sample1.bed")

if name == "main": test_two()

— Reply to this email directly, view it on GitHub https://github.com/limix/pandas-plink/pull/31#issuecomment-1851828662, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF7IBVLME5ZC336KKS6YQ2TYJA3U5AVCNFSM6AAAAAAXP6HCQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHAZDQNRWGI . You are receiving this because you authored the thread.Message ID: @.***>

dbolser commented 9 months ago

Sounds great!

On Wed, Dec 13, 2023, 8:57 PM Richard Border @.***> wrote:

Yeah, no problem. Importing the unittest module okay or keep it simpler?

On Tue, Dec 12, 2023 at 3:11 AM Dan Bolser @.***> wrote:

Can you add a test to catch changes like this in future?

e.g.

def test_two(): import os import tempfile

from pandas_plink import get_data_folder, read_plink1_bin, write_plink1_bin

tmp_path = tempfile.mkdtemp() filename = "chr11.bed"

filename = os.path.join(get_data_folder(), filename)

G = read_plink1_bin(filename, verbose=False) print(G)

write_plink1_bin(G, f"{tmp_path}/sample1.bed")

if name == "main": test_two()

— Reply to this email directly, view it on GitHub https://github.com/limix/pandas-plink/pull/31#issuecomment-1851828662,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AF7IBVLME5ZC336KKS6YQ2TYJA3U5AVCNFSM6AAAAAAXP6HCQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRHAZDQNRWGI>

. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/limix/pandas-plink/pull/31#issuecomment-1854689231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7NEZBYHWUWSUH6WLFKXDYJIJCBAVCNFSM6AAAAAAXP6HCQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJUGY4DSMRTGE . You are receiving this because you commented.Message ID: @.***>

sup3rgiu commented 6 months ago

Up. Still not merged

horta commented 3 months ago

I'm about to release a version that tackles that. Sorry for the wait!!