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

Add printing to remaining classes #31

Merged
merged 18 commits into from
Oct 11, 2024
Merged

Add printing to remaining classes #31

merged 18 commits into from
Oct 11, 2024

Conversation

lazappi
Copy link
Collaborator

@lazappi lazappi commented Oct 11, 2024

Add print() and to_string() methods to the remaining R6 classes. Output tries to replicate the Python formatting except for some cases where the corresponding Python object doesn't have a print output.

@lazappi
Copy link
Collaborator Author

lazappi commented Oct 11, 2024

Examples

Artifact

Python

image

R

image

Field

Python

image

R

image

Instance

R

image

R (to_string())

image

InstanceAPI

R

image

InstanceSettings

R

image

Module

R

image

R (to_string())

image

Record

Python

image

R

image

Registry

Python

image

R

image

R (to_string())

image

@lazappi lazappi requested a review from rcannood October 11, 2024 08:49
.api: API, R6
.module_classes: list
.settings: InstanceSettings, R6
cellxgene Instance(modules='c('core', 'bionty')')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably say something like cellxgene Instance(modules=c('core', 'bionty')).

Given that there is currently no documentation on what you can or cannot do with an Instance class, could we shed some light on:

  • The instance core classes
  • An instance's extra modules (e.g. bionty, wetlab)
  • A list of functions uses can call

Copy link
Collaborator

@rcannood rcannood Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this is something that should be part of something like instance$describe()? Shall I make a separate issue for this?

Copy link
Collaborator Author

@lazappi lazappi Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to the longer format I was using for Module and Registry. I think that should show enough info now. The examples above are updated.

R/Instance.R Outdated Show resolved Hide resolved
Copy link
Collaborator

@rcannood rcannood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rcannood rcannood merged commit bca4137 into main Oct 11, 2024
7 checks passed
@rcannood rcannood deleted the object-printing branch October 11, 2024 11:42
lazappi added a commit that referenced this pull request Oct 14, 2024
* origin/main:
  Add printing to remaining classes (#31)
  Improve error messages (#30)
  Update documentation (#29)
  Return `NULL` when a record's related field is empty (#28)
  minor fix in usage vignette (#32)
  Add usage vignette (#18)
  Add a simple unit test which queries laminlabs/lamindata (#27)
  bump action from v4.5.0 to v4 (#26)
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