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

Object representation improvements #140

Closed
wants to merge 10 commits into from

Conversation

marinagrprat
Copy link
Contributor

@marinagrprat marinagrprat commented Oct 1, 2020

Problem

When we call the object pyxnat it returns just a collection object and an ID number.

Feature

We want to return more information (metadata information) from the object. Some metadata information examples are the age, gender, handedness, insert data, insert user, number of subjects, experiments, scans...etc.

Solution

The changes has been done in resources.py file.
A repr method has been added to each class (Project, Subject, Experiment, Scan and Resource)
Each method is capable to return the main information for each object dynamically (will just appear the information that the obejct contains, the empty fields will not appear) and a link that redirects you to the XNAT page where the object is.
This method allows us to know more information about the object immediately and find out more just clicking the link.

Unit Tests

For each object, 3 tests cases has been added. So in total we have 15 unit tests in a new file tests/repr_test.py.
The tests cover if the object exist, if the object does not exist and if it exists that the information that returns is correct.

@marinagrprat
Copy link
Contributor Author

This PR has been replaced for: #141

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

1 participant