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

Data transfer #18

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Data transfer #18

wants to merge 12 commits into from

Conversation

mburlage
Copy link
Collaborator

Description

Provide a brief description of the PR's purpose here.

Todos

Notable points that this PR has either accomplished or will accomplish.

  • TODO 1

Questions

  • Question1

Status

  • Ready to go

@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #18 (4564b04) into main (fc96cee) will not change coverage.
The diff coverage is 0.00%.

@@ -68,11 +74,18 @@ class CalculationData:
score_mode: ScoreMode = ScoreMode.BEST
k: int = 1
result: Optional[Result] = None
input_file_bytes: Optional[bytes] = None
Copy link
Collaborator

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?


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:
Copy link
Collaborator

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?

if self.input_file is not None:
with open(self.input_file, 'r') as f:
self.input_file_bytes = f.read()
f.close()
Copy link
Collaborator

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?

Copy link
Collaborator

@davidegraff davidegraff left a 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?

Comment on lines 84 to 85
with open(self.input_file, 'rb') as f:
self.input_file_bytes = f.read()
Copy link
Collaborator

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?

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this type correct?

@davidegraff
Copy link
Collaborator

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

test length

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.

None yet

2 participants