-
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
Add quiz tool kit #3
Conversation
mecsimcalc/quiz_utils.py
Outdated
Appends values to a Google Sheet, optionally including a timestamp. | ||
|
||
Parameters: | ||
service_account_info (dict): The service account credentials. |
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.
Try using the format used for other functions in the library. It follows the NumPy docstring style guide. Your current style does not display well on MecSimCalc (not sure why)
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
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.
Hi, I follow the docstring style guide in this link(which looks like is not exact the same with other function). Let me know if there still have problem.
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.
It looks good, however the reason why I repeated the function in the first line is because MecSimCalc doesn't normally display the function. however VS Code does.
Also can you update the other functions to follow the official style guide. I'm not sure why I didn't do it that way originally
here is how it looks on VS Code (shows function + docstring)
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.
@Jiaaming please follow @PointlessUser 's instructions. He's the original author of this repository and will give final approval for this PR to be merged. Thanks
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.
Yes i can update it for other functions. So do you mean keep the first line in order to be viewed normally on Mecsimcalc?
I'm not sure how you preview docstring in MecSimCalc, sorry. Can you give me a bit instruction on it? So I can check it's format, thank you.
Currently I use Sphinx
. My function looks like in HTML:
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.
Yes keep the first line (the function) so it shows up on mecsimcalc.
To view the docstring on mecsimcalc, you just hover over the function. example:
import mecsimcalc as msc
msc.print_plot()
if you hover your mouse over print_plot() it'll show the docstring
On Sphinx, it should look exactly like yours, except you should add the function at the top of the docstring (like mine)
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.
If you're still confused, I could do the changes once we accept your pull request
Heads up, if you want to publish this, you need to update the documentation. However if you are planning to work on this more, this should be fine |
Sure. One more thing: The docs: https://github.com/MecSimCalc/MecSimCalc-docs/blob/main/docs/mecsimcalc-library.md |
Yes, we have to update both the the readme in this library and the docs in the MecSimCalc-docs. The most tedious part is updating the source links. |
mecsimcalc/general_utils.py
Outdated
Examples | ||
-------- | ||
Without metadata: | ||
>>> input_file = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..." |
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 reason we had input_file = inputs["input_file"]
is because this is how users will store the data on mecsimcalc
Although this might be the actual data being stored, but nobody will input it this way
input_file = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
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.
Please fix this for all other functions as well
mecsimcalc/spreadsheet_utils.py
Outdated
|
||
Examples | ||
-------- | ||
Without Download Link: |
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 reason why the original was in this format:
>>> input_file = inputs["input_file"]
>>> df = msc.input_to_dataframe(input_file)
is because this is how users would normally use the function.
Changing it to:
df = pd.DataFrame({'A': [1, 4], 'B': [2, 5], 'C': [3, 6]})
makes it harder for new users to understand. Especially non experienced programmers
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.
didn't pay attention to that, sorry. I go through them again and reset examples to original format.
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 good
Thanks. Can we publish it? I will also update the mecsimcalc-docs on the website. |
@Jiaaming approved and merged!
NEXT STEPS:
|
Got it, thanks. |
@Jiaaming don't forget to update the README here when you update the docs |
Hi. Based on Prof. Samer's requirements, I've added two quiz helper functions (Google Sheets/Gmail integration) to our library. This is my first time modifying the package, so please don't hesitate to point out any issues or non-standard practices.
For more details: https://east-flax-094.notion.site/Quiz-Toolkit-mecsimcalc-ee9f43e25bf8429b9a01cd7095273361