-
Notifications
You must be signed in to change notification settings - Fork 4
Develop Context class
#34
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
Develop Context class
#34
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 89.68% 90.95% +1.27%
==========================================
Files 12 12
Lines 630 774 +144
Branches 104 87 -17
==========================================
+ Hits 565 704 +139
- Misses 42 46 +4
- Partials 23 24 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. A couple quick notes.
7c10dda to
0d427f4
Compare
9185ba7 to
72dbbeb
Compare
for Sessions class and associated tests for Context class
|
I just added the tests for the |
|
Makes sense to me. I would just skip |
|
Started playing around with this and I'm using the
|
|
I would actually probably create def walk(directory, dataset, subject=None):
if subject is None and is_subject_dir(directory):
subject = Subject(directory, dataset)
for child in directory.children:
yield Context(child, dataset, subject)
if child.is_dir():
yield from walk(child, dataset, subject)
tree = FileTree.read_from_filesystem(root)
dataset = Dataset(root, schema)
for context in walk(tree, dataset):
... |
|
Right, that does make sense. This should be in |
|
Also, am I right in thinking that we'll still be using the |
Yes, or wherever we do the walk.
Yes,
Yes.
Seems excessive. What do you think about making |
Include schema as input param and instansiate dataset object
now takes dataset as input param, generates subject object if required, and yields context object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple notes.
walk now returns context object which needs to be handled differently
c1c8bc2 to
85f7733
Compare
|
I ended up using a |
|
We've tied ourselves pretty tightly to the filesystem here, which makes mocking up objects difficult, as well as anything where we won't have access to directory entries, like datasets in the cloud. I think it probably makes sense to wrap a I think we could then create mock files for testing by subclassing Or possibly we end up with a |
|
Resetting to draft, pending columns implementation. |
|
Made a PR against your PR: ubdbra001#1 Can factor it out, if you prefer. It's mostly orthogonal. |
rf: Replace direntry with UPath in FileTree
|
I've added the code for the |
Co-authored-by: Chris Markiewicz <[email protected]>
closes #32 (eventually)
I'm happy to leave this open and just add to it as I approach the rest of the methods, but if you'd like to open a PR for each of the rest of the methods then I'm also happy to defer to you on that.
Here's my initial attempt at this:
Context(path, entities, datatype, suffix, extension, modality, and size) and added stubs for the restOne thing I wasn't sure about is where it would be beneficial to use
cached_propertyoverpropertyfor this class (and I suppose more generally). Any advice?My next step will be to develop the
subjectsmethod along with theSessionsclass. I think I'll start by creating test for these (so you can make sure I understand how these are meant to work) and then go from there.