-
Notifications
You must be signed in to change notification settings - Fork 3
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
Initial refactoring of process_report #54
Conversation
process_report/util.py
Outdated
institution_name = institute_map.get(institution_key, "") | ||
|
||
if institution_name == "": | ||
print(f"Warning: PI name {pi_uname} does not match any institution!") |
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 would encourage the use of the logging
module for emitting error and warning messages.
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.
@knikolla Should this become its own PR, or do I make use of logging
in this intial refactor PR?
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.
@QuanMPhm For the specific invoices that you are refactoring in this PR, make use of logging.
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.
Looks pretty good! Don't see any broken conventions, haha.
|
||
@dataclass | ||
class NonbillableInvoice(invoice.Invoice): | ||
"""""" |
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.
Either write a docstring for the class or remove the double quotes.
This refactor commit is the first of a few, to lay out intial structure A new submodule, `invoices`, is added, containing a base class `Invoice` which is inherited by all other invoices. Currently, only the lenovo and nonbillable invoice has classes which inherits from `Invoice` Also created and partially populated an `util.py` file, containing functions placed above `main()` in `process_report.py` After the refactoring process is fully complete, these utility functions will be completely removed from `process_report.py`
3a82feb
to
02c84ed
Compare
Closes #63 . This refactor commit is the first of a few, to lay out initial structure
A new submodule,
invoices
, is added, containing a base classInvoice
which is inherited by all other invoices. Currently, only the lenovo and nonbillable invoice has classes which inherits fromInvoice
Also created and partially populated anutil.py
file, containing functions placed abovemain()
inprocess_report.py
After the refactoring process is fully complete,these utility functions will be completely removed from
process_report.py
I can already tell I am breaking several Python conventions, so I am ready.