-
Notifications
You must be signed in to change notification settings - Fork 1
src(gates): Use cattrs + attrs #136
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
Conversation
a9a6a34
to
1bd0005
Compare
9ca5815
to
1376c13
Compare
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.
TODO: update the docs to show the correct/simplest usage pattern sometime.
4d41f4d
to
24fd433
Compare
24fd433
to
57715d6
Compare
57715d6
to
a7907fe
Compare
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.
Quick scan to start. Can you rebase next time you push please?
a7907fe
to
d5b5457
Compare
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.
Sorry for being so slow!
Looking good, almost ready to land.
4128181
to
7199a93
Compare
9da4d58
to
e1e4a2d
Compare
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.
Much improved interface. A few more questions on it though.
cellengine/resources/experiment.py
Outdated
"""Create a RectangleGate. | ||
|
||
Accepts all args and kwargs available for | ||
[`RectangleGate.create()`][cellengine.resources.gate.RectangleGate.create]. | ||
""" | ||
return RectangleGate.create( | ||
self._id, *args, create_population=create_population, **kwargs |
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.
Would it work to keep all of the named args and pass all of them to RectangleGate.create()
? Know it's a lot of code, but it would make type info work.
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.
The args/kwargs, not the docstring, right? We certainly can, but it means we have to maintain them in two places.
The type info actually works for me; this is the hint I get:
def create_rectangle_gate(self, x_channel: str, y_channel: str, name: str, x1: float, x2: float, y1: float, y2: float, label: List[float]=[], gid: Optional[str]=None, locked: bool=False, tailored_per_file: bool=False, fcs_file_id: Optional[str]=None, fcs_file: Optional[str]=None, parent_population_id: str=None, /, *, create_population=True, x_channel: str, y_channel: str, name: str, x1: float, x2: float, y1: float, y2: float, label: List[float]=[], gid: Optional[str]=None, locked: bool=False, tailored_per_file: bool=False, fcs_file_id: Optional[str]=None, fcs_file: Optional[str]=None, parent_population_id: str=None) -> RectangleGate
Let me know what you think
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.
3a85787
to
25cc0c2
Compare
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
==========================================
- Coverage 93.63% 92.83% -0.80%
==========================================
Files 67 60 -7
Lines 2906 3084 +178
==========================================
+ Hits 2721 2863 +142
- Misses 185 221 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
RectangleGate is almost there. These comments apply to the other gate classes, but I didn't read through them yet.
158ce7f
to
de34f53
Compare
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.
Just one last suggestion and a typo.
097b08e
to
d672d65
Compare
d672d65
to
9ed26e7
Compare
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.
I fixed up a bunch of stuff and pointed out a few of the changes below. All of gate.py has no type errors and all of the integration tests pass now. https://github.com/primitybio/cellengine-python-toolkit/compare/d672d65..8c957bb
(Saving test responses was a bad idea of mine here and in the R toolkit -- too much work to keep up with the changes and we don't catch errors when API changes break the toolkit. I just added GitHub action secrets for CellEngine credentials to let us run integration tests against the real API.)
8c957bb
to
c4df360
Compare
c4df360
to
7c59370
Compare
gate.parentPopulationId
has been removed from the API #125 )Depends on #128 , #133 (will break until 128 is merged)
Fixes #118, #130
Supersedes #131 , since the underlying code changes quite a bit