-
Notifications
You must be signed in to change notification settings - Fork 32
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
Data transfer #18
base: main
Are you sure you want to change the base?
Data transfer #18
Conversation
@@ -68,11 +74,18 @@ class CalculationData: | |||
score_mode: ScoreMode = ScoreMode.BEST | |||
k: int = 1 | |||
result: Optional[Result] = None | |||
input_file_bytes: Optional[bytes] = None |
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.
is bytes
the correct type here?
pyscreener/docking/data.py
Outdated
|
||
def __post_init__(self): | ||
self.in_path = Path(self.in_path) | ||
self.out_path = Path(self.out_path) | ||
|
||
if self.input_file is not None: | ||
with open(self.input_file, 'r') as f: |
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.
do we need to read in text mode?
pyscreener/docking/data.py
Outdated
if self.input_file is not None: | ||
with open(self.input_file, 'r') as f: | ||
self.input_file_bytes = f.read() | ||
f.close() |
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.
why close()
inside a with
block?
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 testing is getting there! can you try and create the input files using @pytest.fixture
?
pyscreener/docking/data.py
Outdated
with open(self.input_file, 'rb') as f: | ||
self.input_file_bytes = f.read() |
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.
can you make this a one-liner using pathlib.Path
?
pyscreener/docking/data.py
Outdated
@@ -74,16 +74,15 @@ class CalculationData: | |||
score_mode: ScoreMode = ScoreMode.BEST | |||
k: int = 1 | |||
result: Optional[Result] = None | |||
input_file_bytes: Optional[bytes] = None | |||
input_file_bytes: Optional[str] = None |
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.
is this type correct?
also make sure to fix your tests so they work with the CI. You'll need to add your testing files to the repo for that |
f.close() | ||
data = CalculationData(smi, None, None, None, None, input_file = p) | ||
assert data.input_file_bytes == file_bytes |
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.
test length
Description
Provide a brief description of the PR's purpose here.
Todos
Notable points that this PR has either accomplished or will accomplish.
Questions
Status