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

Expand support for creating new artifacts #85

Merged
merged 18 commits into from
Nov 19, 2024
Merged

Conversation

lazappi
Copy link
Collaborator

@lazappi lazappi commented Nov 19, 2024

This PR:

  • Adds a from_path() method to create artifacts from paths
  • Adds a from_anndata() method to create artifacts from AnnData objects

Removed

  • Adds a from_dir() method to create lists of artifacts from directories
  • Adds a Instance$save() method which can save lists of records

Checklist:

  • Add tests (partially)
  • Pass CI checks
  • Update man pages and regenerate
  • Add new features to vignettes
  • Update architecture vignette
  • Update development vignette
  • Update features in README
  • Update CHANGELOG

@lazappi
Copy link
Collaborator Author

lazappi commented Nov 19, 2024

There are some differences from the Python interface here:

  • from_file() doesn't exist in Python which instead uses ln.Artifact(). This kind of interface is only possible with some hacky workarounds.
    • Alternatively, we could have $create() or similar which replicates what Python does.
  • The Python ln.save() is optimised for speed and doesn't create related records. Instead, the current Instance$save() just calls record$save() for each record in the list. Something similar to Python is probably possible but needs some more work.

@falexwolf
Copy link
Member

Great! 🤩

One question: Rather than calling it from_file(), should it maybe be called from_path()? Otherwise we also need from_folder() and that'd be very confusing with from_dir().

If possible, to be honest, I'd hold off from adding from_dir() to the API -- we might even remove it from Python or rename it somehow because it's pretty confusing that it returns a list of artifacts rather than a single artifact or the whole directory.

R/Registry.R 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 98a97e7 into main Nov 19, 2024
7 checks passed
@rcannood rcannood deleted the expand-new-artifacts branch November 19, 2024 13:24
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.

3 participants