-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/initial bifrost2 #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bad name, but I like the concept. Each time a file changes, it re-runs allowing you to see when tests fail. More interestingly is that unlike using watch for accomplish this, you can also debug your code with pdb
Wraps functions which return awaitables for use in a blocking fashion while still providing access to them via an aio submodule of each class.
Each Bifrost Python class will now have a static method to get the corresponding JS Class' constructor! Useful for comparisons among other things.
As well as some minor refactors...
This sets up a simple algorithm for setting up a bifrost dcp module system out of the cjs dcp-client modules.
wiwichips
commented
Jun 26, 2024
internal implementation details are leaked when one imports dcp, need to limit that |
bfclass class maker is ugly and should be cleaned up |
And then await it only if the value it returns is awaitable...
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 2, 2024 18:06
5e018f7
to
2217eb5
Compare
wiwichips
commented
Jul 3, 2024
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 3, 2024 19:10
ecd72e4
to
ee5c069
Compare
so it will be easier to change the arch to use a single event loop...
This is a temporary ugly patch to accomplish this, it should be refactored into something cleaner later...
wiwichips
commented
Jul 4, 2024
- pass js instance to class directly - don't bother with aio_ctor or aio_methods - simplify code / make code more pythonic
At some point it didn't make sense to store the event loop in aio, but now it could make sense... maybe elsewhere would be better but maybe not! Also I initially had aio be fn (for managing functions) so I had a comment TODO for checking return values. Now that is no longer needed
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
3 times, most recently
from
July 8, 2024 14:57
9ce96ae
to
016823e
Compare
And clean up the code.
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 8, 2024 15:01
016823e
to
129d907
Compare
This seems to be good enough for dcp classes
Unfortunately the ResultHandle class is a proxy to an iterator, which means it's difficult to get good introspection into it... But we can use duck typing to check for this special case )''':
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 10, 2024 13:29
6d6e19b
to
2bd49bc
Compare
For instance, dcp.compute.for is "hidden", - it doesn't show up as own property. We'll still want people to be able to use it... Well not "for" since that's a syntax error but "do"!
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 10, 2024 17:27
4fc825d
to
e388205
Compare
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 10, 2024 19:39
a5b06b6
to
d08a23e
Compare
wiwichips
commented
Jul 10, 2024
wiwichips
force-pushed
the
feature/initial-bifrost2
branch
from
July 10, 2024 21:53
0e9196b
to
e6d2dae
Compare
Merging now since this is the initial PR which will enable others to contribute. |
Severn-J-Lortie
pushed a commit
that referenced
this pull request
Aug 8, 2024
Draft: Feature/initial bifrost2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Initial Bifrost 2 Structure
This PR contains the base set up for Bifrost 2 (the new Python SDK for DCP). It outlines the file structure of the module, and the dev tools used (poetry for Python management and testing, pminit for npm install for instance).
File structure
Module logic is in
dcp/
, tests are intests/
...dcp.api
job.wait()
andcompute_for
livedcp.dry
dcp.js
dcp-client
(note: the file structure is subject to change and may have changed by the time you review this PR)
Module initialization algorithm
When
dcp.init()
is called a module system is programatically generated which matches the JavaScript CJS modules. At the same time, any classes, or functions come across are automatically converted to more Pythonic structures.List of things this PR does