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

Prepare release of version 1.0.0 #64

Merged
merged 51 commits into from
Feb 15, 2024
Merged

Prepare release of version 1.0.0 #64

merged 51 commits into from
Feb 15, 2024

Conversation

sdjmchattie
Copy link
Contributor

Changes proposed in this pull request

  • Add in the changes to use Traction v2 API data format.

Instructions for Reviewers

  • [All PRs] - Confirm PR template filled
  • [Feature Branches] - Review code
  • [Production Merges to master]
    • Check story numbers included
    • Check for debug code
    • Check version

yoldas and others added 30 commits January 3, 2024 00:31
Bumps tj-actions/changed-files from 23 to 41.
Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.28.2...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.12.7 to 2023.7.22.
- [Commits](certifi/python-certifi@2022.12.07...2023.07.22)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.14 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@1.26.14...1.26.18)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.3 to 3.9.0.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.8.3...v3.9.0)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Bump certifi from 2022.12.7 to 2023.7.22
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.0 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.0...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Also lay the docstring out according to Google's style guide
It doesn't make sense for it to be a dictionary when we iterate over it by expecting all keys in a range the same size as the length of the entries in the dictionary!
This also includes those for OutputTractionMessageInterface and TractionQcMessageInterface
Code elsewhere assumes the indices are non-sparse so we should be using a list
@sdjmchattie sdjmchattie changed the title Prepare release of version 0.4.0 Prepare release of version 1.0.0 Feb 15, 2024
request.post_spri_volume = "20"
request.final_nano_drop_280 = "280"
request.final_nano_drop_230 = "230"
request.final_nano_drop = "200"
Copy link
Member

Choose a reason for hiding this comment

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

Could you confirm that representing numbers as strings is correct use?

Copy link
Contributor Author

@sdjmchattie sdjmchattie Feb 15, 2024

Choose a reason for hiding this comment

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

@@ -79,7 +83,7 @@ def test_can_generate_correct_payload(self, valid_traction_qc_message):
"shearing_qc_comments": "Comments",
"date_submitted": datetime.now().timestamp() * 1000,
Copy link
Member

Choose a reason for hiding this comment

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

datetime.now without timezone is locale dependent I suppose. Does this matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is fine in a test. I would be concerned if it was part of the code creating messages or logs to be sent out. I'll update it in the test anyway to avoid misleading someone who sees this and thinks that's how you create the timestamp in messages.


DEFAULT_LOGGING_LEVEL = "INFO"

LOGGING: Dict[str, Any] = {
LOGGING: dict[str, Any] = {
Copy link
Member

Choose a reason for hiding this comment

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

I was assuming type declaration is done uppercase but lowercase seems fine. As the Dict is removed from import statement from typing module, could you confirm using lowercase dict here is right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Python 3.9, they've removed the redundancy of having List and Dict in the typing package for the use of generics. In the past, if you used the lowercase list and dict you couldn't specify the inner types of those. That was worked around using the typing package, but that's no longer necessary due to improvements to the core Python language, so I got rid of them.

https://peps.python.org/pep-0585/

@@ -44,24 +44,24 @@ def pad_number(self, number: int) -> str:
padded_number = f"0{padded_number}"
Copy link
Member

Choose a reason for hiding this comment

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

if padded_number is 10, this will make 010 . Is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because the line before it checks for a length 1 string, but I don't know why Eduardo implemented it this way when str has a zfill() method precisely for padding numbers with zeroes. I'll update it.

Copy link
Member

@yoldas yoldas left a comment

Choose a reason for hiding this comment

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

I have added a few questions to make sure. Looks good.

sdjmchattie and others added 3 commits February 15, 2024 16:41
Remove the padding method and turn the location creation into a list comprehension
Not strictly necessary, but it's better practice than the locale affected now() method
@sdjmchattie sdjmchattie merged commit 0d750fe into master Feb 15, 2024
10 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.

3 participants