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 false positive fortran order warning #151

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

hofaflo
Copy link
Contributor

@hofaflo hofaflo commented Nov 26, 2021

Executing the example code for writing an edf file via the highlevel interface:

import numpy as np
from pyedflib import highlevel

signals = np.random.rand(5, 256*300)*200
channel_names = ['ch1', 'ch2', 'ch3', 'ch4', 'ch5']
signal_headers = highlevel.make_signal_headers(channel_names, sample_frequency=256)
header = highlevel.make_header(patientname='patient_x', gender='Female')
highlevel.write_edf('edf_file.edf', signals, signal_headers, header)

causes the following warning to be issued, even though the array is in C-order:

UserWarning: signals are in Fortran order. Will automatically transfer to C order for compatibility with edflib.

This is because the check for fortran order iterates over all passed arrays, which are then 1d-arrays, so they are always both c_contiguous and f_contiguous.

@skjerns
Copy link
Collaborator

skjerns commented Nov 26, 2021

Seems like a good addition! Thanks a lot! :)

@skjerns skjerns merged commit 5936cb8 into holgern:master Nov 26, 2021
@hofaflo hofaflo deleted the fortrancheck branch November 26, 2021 12: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.

None yet

2 participants