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

Create records from data frames #78

Merged
merged 30 commits into from
Nov 18, 2024
Merged

Create records from data frames #78

merged 30 commits into from
Nov 18, 2024

Conversation

lazappi
Copy link
Collaborator

@lazappi lazappi commented Nov 14, 2024

When finished this PR should:

  • Add a from_df() method to (Artifact) registries to create artifacts from data frames
  • Modify printing for Record classes to avoid API calls (needed for temporary records)
  • Add temporary record classes for records that have been created but not yet saved
  • Add a "default instance" mechanism that limits one instance to creating records
  • A a delete() method to records

Other Todos:

  • Clean up and style changes
  • Document new functions
  • Add tests
  • Check CI passes
  • Add saving to vignette (?)
  • Update functionality documentation
  • Update architecture documentation
  • Update CHANGELOG

Removed:

  • Allow loading CSV and TSV artifacts
  • Allow loading Parquet artifacts

R/Registry.R Outdated Show resolved Hide resolved
R/file_handlers.R Outdated Show resolved Hide resolved
R/Registry.R Outdated Show resolved Hide resolved
rcannood added a commit that referenced this pull request Nov 14, 2024
Co-authored-by: Luke Zappia <lazappi@users.noreply.github.com>
@lazappi lazappi marked this pull request as ready for review November 15, 2024 13:01
R/Artifact.R Outdated Show resolved Hide resolved
R/InstanceAPI.R Show resolved Hide resolved
R/Instance.R Outdated
Comment on lines 1 to 4
create_instance <- function(instance_settings, is_default = FALSE, py_lamin = NULL) {
super <- NULL # satisfy linter

api <- InstanceAPI$new(instance_settings = instance_settings)
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Can we create py_lamin inside of create_instance similar to how api is also created here depending on the value of is_default?
  • If we create it in this function, we could also use lazy loading instead of immediately creating it here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved it but I deliberately wanted to check when the instance is created so users knows ASAP if they can't do some things. We could change that if you want though.

R/Instance.R Outdated
Comment on lines 269 to 271
py_lamin = function() {
private$.py_lamin
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

api is a public function. maybe make py_lamin also a public function instead of an active field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved. I'm not sure it actually helps to store the imported module so we can could also load it as needed.

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.

One more question: could you also update the list of features to include the functionality that this PR adds?

rcannood added a commit that referenced this pull request Nov 15, 2024
* Migrate code from #78 to separate branch

Co-authored-by: Luke Zappia <lazappi@users.noreply.github.com>

* update imports

* add more data loaders, align file and function naming to python implementation

* wip add tests

* run styler

* add entry to changelog

* don't use expect_equal to compare anndatas

* Update R/core_loaders.R

Co-authored-by: Luke Zappia <lazappi@users.noreply.github.com>

* suggestions from review

* fix roxygen

* apply suggestion from review

* update documentation

---------

Co-authored-by: Luke Zappia <lazappi@users.noreply.github.com>
@lazappi lazappi changed the title WIP: Create records from data frames Create records from data frames Nov 18, 2024
@lazappi
Copy link
Collaborator Author

lazappi commented Nov 18, 2024

One more question: could you also update the list of features to include the functionality that this PR adds?

Added to the README. I already did the development vignette. Let me know if there is anywhere else.

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!

@lazappi lazappi merged commit 804cb06 into main Nov 18, 2024
7 checks passed
@lazappi lazappi deleted the add-dataframe-artifacts branch November 18, 2024 12:29
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