pandas-plink icon indicating copy to clipboard operation
pandas-plink copied to clipboard

replaced deprecated pandas lineterminator arg

Open rborder opened this issue 2 years ago • 5 comments

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.

rborder avatar Apr 29 '23 03:04 rborder

Looks good to me

dbolser avatar Dec 12 '23 10:12 dbolser

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()

dbolser avatar Dec 12 '23 11:12 dbolser

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: @.***>

rborder avatar Dec 13 '23 20:12 rborder

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: @.***>

dbolser avatar Dec 13 '23 21:12 dbolser

Up. Still not merged

sup3rgiu avatar Mar 05 '24 10:03 sup3rgiu

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

horta avatar Jun 18 '24 14:06 horta