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

Working on adding entity_message #593

Merged
merged 39 commits into from
Nov 27, 2022
Merged

Working on adding entity_message #593

merged 39 commits into from
Nov 27, 2022

Conversation

rcali21
Copy link
Contributor

@rcali21 rcali21 commented Nov 2, 2022

WIP-Entity message in BIDS Prov

@rcali21
Copy link
Contributor Author

rcali21 commented Nov 2, 2022

Hi @djarecka,

Couple questions....

When I have the following JN test:

shelly = pydra.ShellCommandTask(name='shelly', in_file=file, executable=cmd, audit_flags=AuditFlag.PROV, messengers=PrintMessenger())
print(shelly.inputs.in_file)

I am unable to retrieve the in_file from the print statement and instead I'm left with "Inputs has no attribute 'in_file'" even though I define it as a path to a file in a previous line. I will need this in order to fill the 'at_location' field in entity by getting the abs. path of the in_file.

Additionally, you will see that I have added self.audit_message again at the end of audit.py. I'm assuming there is a more elegant way to add another message to self.audit_message.

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Base: 76.77% // Head: 76.81% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (19beeba) compared to base (4b9df08).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #593      +/-   ##
==========================================
+ Coverage   76.77%   76.81%   +0.04%     
==========================================
  Files          19       19              
  Lines        4349     4357       +8     
  Branches     1193     1194       +1     
==========================================
+ Hits         3339     3347       +8     
  Misses        821      821              
  Partials      189      189              
Flag Coverage Δ
unittests 76.72% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pydra/engine/audit.py 92.50% <100.00%> (+0.83%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rcali21
Copy link
Contributor Author

rcali21 commented Nov 2, 2022

Wondering if we should strip the filename and just return dir path. 1cc91ef

@djarecka
Copy link
Collaborator

djarecka commented Nov 2, 2022

Hi @djarecka,

Couple questions....

When I have the following JN test:

shelly = pydra.ShellCommandTask(name='shelly', in_file=file, executable=cmd, audit_flags=AuditFlag.PROV, messengers=PrintMessenger())
print(shelly.inputs.in_file)

I am unable to retrieve the in_file from the print statement and instead I'm left with "Inputs has no attribute 'in_file'" even though I define it as a path to a file in a previous line. I will need this in order to fill the 'at_location' field in entity by getting the abs. path of the in_file.

I don't see input_spec in your example, so in_file is not treated as an input, we talked about it last time

@rcali21
Copy link
Contributor Author

rcali21 commented Nov 3, 2022

Will add accompanying pytest for d0770b4 later today.

@djarecka
Copy link
Collaborator

djarecka commented Nov 3, 2022

I think your current tests stopped working, it might be good to figure out this first

pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
@djarecka
Copy link
Collaborator

djarecka commented Nov 4, 2022

you fixed the tests, nice! you should add more tests for entity now, I also left some comments, we can discuss them later today if something is not clear

@rcali21
Copy link
Contributor Author

rcali21 commented Nov 7, 2022

@djarecka What are your thoughts on adding a test that uses a task that requires file manipulation? Would be helpful for me in further development. Is it best to use a nifti file living on the repo like in nipype, or should we just create a scratch .txt file and then delete it each run?

pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
pydra/engine/audit.py Outdated Show resolved Hide resolved
@djarecka
Copy link
Collaborator

@rcali21 - thanks for fixing most of the issues, but I'm not sure why you just removed the second file from the input in test test_audit_shellcommandtask_file. As we discussed that is a good test that checks what happens when you have multiple files as an input. It just needed to be fixed

@rcali21
Copy link
Contributor Author

rcali21 commented Nov 27, 2022

@rcali21 - thanks for fixing most of the issues, but I'm not sure why you just removed the second file from the input in test test_audit_shellcommandtask_file. As we discussed that is a good test that checks what happens when you have multiple files as an input. It just needed to be fixed

Resolved in 662ade1.

@djarecka
Copy link
Collaborator

Thanks @rcali21 for fixing the test! I know we were talking about adding output in this PR, but I will merge this now, and output can be done in a separate PR. Also, the connection of input and output to the task will have to be added

@djarecka djarecka merged commit a5dfe42 into nipype:master Nov 27, 2022
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.

2 participants