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] read_acqknowledge now also imports duplicated channel names #975

Conversation

DerAndereJohannes
Copy link
Contributor

Description

This PR aims at fixing the read_acqknowledge file which skipped duplicated channel names (e.g., Digital input channels)

Proposed Changes

I changed the read_acqknowledge in such a way where instead of iterating through the named_channels, it now iterates through the list of channels (by index) and add the channel.name to a counter. If there is a duplicate, the channel name now adds a number e.g., (1) to the end of the channel name if the channel has already been added.

Example difference

Before:

print(data.columns)
Index(['PPG, Y, PPGED-R', 'RSP, Y, RSPEC-R', 'EMG A, Y, EMG2-R',
       'SKT A, Y, SKT2-R', 'SKT B, X, SKT2-R', 'ECG, X, RSPEC-R',
       'EMG B, X, EMG2-R', 'EDA, X, PPGED-R', 'Digital input'],
      dtype='object')

After:

print(data.columns)
Index(['PPG, Y, PPGED-R', 'RSP, Y, RSPEC-R', 'EMG A, Y, EMG2-R',
       'SKT A, Y, SKT2-R', 'SKT B, X, SKT2-R', 'ECG, X, RSPEC-R',
       'EMG B, X, EMG2-R', 'EDA, X, PPGED-R', 'Digital input',
       'Digital input (1)', 'Digital input (2)', 'Digital input (3)',
       'Digital input (4)', 'Digital input (5)', 'Digital input (6)',
       'Digital input (7)'],
      dtype='object')

Checklist

Here are some things to check before creating the PR. If you encounter any issues, do let us know :)

  • I have read the CONTRIBUTING file.
  • My PR is targeted at the dev branch (and not towards the master branch).
  • I ran the CODE CHECKS on the files I added or modified and fixed the errors.
  • I have added the newly added features to News.rst (if applicable)

Copy link

welcome bot commented Mar 22, 2024

Thanks for opening this pull request! We'll make sure it's perfect before merging 🤗 force
Make sure to read the contributing guide. Also, if you think that your contribution is worthy of it, you can consider adding yourself to the Contributors list (feel free to ask us if you have any doubts).

@DominiqueMakowski DominiqueMakowski merged commit 24939c7 into neuropsychology:dev Mar 24, 2024
8 checks passed
Copy link

welcome bot commented Mar 24, 2024

landing
Congrats on merging your first pull request! 🎉🍾 We're looking forward to your next one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants