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

Added Study Room Functions to to Library Module #177

Merged
merged 37 commits into from
Jun 13, 2024

Conversation

ghosteau
Copy link
Contributor

@ghosteau ghosteau commented Jun 9, 2024

  • Added a function to check reserved Hillman library study room times, tied to which room is specifically reserved
  • Added another function to check the total amount of reserved rooms in the Hillman library

ghosteau added 6 commits June 9, 2024 03:06
Tells the user how many reservations are in the Hillman library, and also tells the user what rooms and times are reserved in the Hillman library.
Copy link
Contributor Author

@ghosteau ghosteau left a comment

Choose a reason for hiding this comment

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

Some very slight spacing changes may have been made to lab module because I wanted to revert it back on my fork. Just ignore all changes outside of the library module

@tianyizheng02
Copy link
Contributor

Please run black . in your local git repo to fix the formatting issues

@ghosteau
Copy link
Contributor Author

ghosteau commented Jun 9, 2024

I ran black through cmd, let me know if there is anything else that needs done.

pittapi/course.py Outdated Show resolved Hide resolved
Co-authored-by: Tianyi Zheng <[email protected]>
black Outdated Show resolved Hide resolved
@ghosteau
Copy link
Contributor Author

I think I dealt with the merger conflicts -- I elected to choose the segments that were formatted with black to hopefully make readability for the API better for some portions. Do let me know if there is anything else, or anything I missed.

tests/course_test.py Outdated Show resolved Hide resolved
tests/dining_test.py Outdated Show resolved Hide resolved
tests/mocks/course_mocks.py Outdated Show resolved Hide resolved
tests/mocks/course_mocks.py Outdated Show resolved Hide resolved
tests/textbook_test.py Outdated Show resolved Hide resolved
Copy link
Contributor

@tianyizheng02 tianyizheng02 left a comment

Choose a reason for hiding this comment

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

I think all the biggest issues (syntax errors, etc) have been fixed, so we can now let GitHub run our repo workflows on this PR before I comment on anything else in the code

@tianyizheng02
Copy link
Contributor

So there were still more errors with black cuz we run black with extra command-line args and that was messing with things... I ran black again locally and pushed a commit to get the workflows to pass, sorry about all the fuss

pittapi/library.py Outdated Show resolved Hide resolved
pittapi/library.py Outdated Show resolved Hide resolved
pittapi/library.py Outdated Show resolved Hide resolved
pittapi/library.py Show resolved Hide resolved
Copy link
Contributor

@tianyizheng02 tianyizheng02 left a comment

Choose a reason for hiding this comment

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

The GitHub workflow is failing because of formatting issues. For future contributions, I highly, highly recommend that you set up pre-commit and other tooling that we use in this repo (I have a write-up on how to set up everything in #170, but it hasn't been merged yet). Pre-commit automatically checks for certain issues and runs tools like black before you make a git commit, so it streamlines everything and you don't need to worry about formatting and stuff yourself.

pittapi/library.py Outdated Show resolved Hide resolved
pittapi/library.py Outdated Show resolved Hide resolved
pittapi/library.py Outdated Show resolved Hide resolved
ghosteau and others added 5 commits June 12, 2024 20:27
- Added space at end of file
- Enforced 2 spaces between functions
I added unit tests for both of the new functions and updated the sample path variable.

For some reason I was having issues with the original sample path, so I updated it so the testing works good for all functions in the library_test file now.
@ghosteau
Copy link
Contributor Author

I wrote the unit tests and I believe I cleaned up all of the slight errors with the hints and spacing. Let me know if there is anything else that needs done!

For the unit tests I did make a new class for the new extension of the library module. If you want, I can add it to the old class, but I figured it would be easier to separate them since they do use different links and different mock JSONs.

I also had to update the path to be SAMPLE_PATH = Path(__file__).parent / "samples" instead, because for some reason the tests were encountering issues using the previous method.

@tianyizheng02
Copy link
Contributor

I think it looks good, let's run the test workflow and see if there are any issues

Copy link
Contributor

@tianyizheng02 tianyizheng02 left a comment

Choose a reason for hiding this comment

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

black is throwing an error again because of some minor formatting stuff (even though personally I think your code is fine)... see my comments below

tests/library_test.py Outdated Show resolved Hide resolved
tests/library_test.py Outdated Show resolved Hide resolved
tests/library_test.py Outdated Show resolved Hide resolved
ghosteau and others added 3 commits June 13, 2024 00:58
@tianyizheng02
Copy link
Contributor

Everything looks good! The only thing left is to update all the type hints to use the built-in types rather than the typing library types (I cleaned up most of the types throughout the repo in a different PR, so it's best that we keep things consistent now). I'll handle this edit myself because GitHub's suggestion system limits where I can leave suggestions.

@ghosteau
Copy link
Contributor Author

Sounds good! I appreciate all of the help with the formatting especially!

Copy link
Contributor

@tianyizheng02 tianyizheng02 left a comment

Choose a reason for hiding this comment

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

All workflows/tests are passing, and I think everything looks good! Thanks for your work and for your patience with the tooling. As mentioned earlier, I highly recommend learning how to install and use pre-commit and other tools (see CONTRIBUTING.md), because that'll make the PR process much easier and more straightforward for everyone.

@tianyizheng02 tianyizheng02 merged commit 5f7ad48 into pittcsc:dev Jun 13, 2024
4 checks passed
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.

2 participants