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

Improve non-parallel demo #40

Merged
merged 16 commits into from
Mar 11, 2024
Merged

Improve non-parallel demo #40

merged 16 commits into from
Mar 11, 2024

Conversation

CodyCBakerPhD
Copy link
Member

Emphasizing this demo as a more expansive 'how to' by enhancing the readability of all Pythonic parts

Should probably do the same for the script part of the _client.html, probably using in-line comments (unless there's a notion of docstrings in HTML?)

I did break something as of the latest commit however; the progress bar runs on the console but must not be sending updates properly to the client - can you take a look and see if you can get it working without altering too much of the current nesting structure?

I can see how some of the local scoping was necessary - this was harder to determine from the anonymized callable (lambda) representation - but I've tried to denest it and document it as thoroughly as possible

CodyCBakerPhD and others added 4 commits March 3, 2024 13:18
* Simplify synchronous demo

* Update docs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@CodyCBakerPhD CodyCBakerPhD self-assigned this Mar 11, 2024
This is a class that handles the WebSocket connections and the communication protocol
between the server and the client.

While we could have implemented this as a function, a class is chosen here to maintain reference
Copy link
Member Author

Choose a reason for hiding this comment

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

If it's not too arduous, could you show me what the functional form of this would look like in a separate PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Amazing. Reads much cleaner that way IMO

Four well-documented functions explain exactly what needs to be scoped in what, with all function and variable names explicit in their purpose

CodyCBakerPhD and others added 3 commits March 11, 2024 13:56
* Update _server.py

* more keyword arguments; break up docstring; remove unused capture

* more keyword arguments

---------

Co-authored-by: Garrett Michael Flynn <[email protected]>
@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review March 11, 2024 18:25
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 53 lines in your changes are missing coverage. Please review.

Project coverage is 39.77%. Comparing base (67faf3e) to head (ff27c0e).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##              main      #40       +/-   ##
============================================
- Coverage   100.00%   39.77%   -60.23%     
============================================
  Files            3        5        +2     
  Lines           35       88       +53     
============================================
  Hits            35       35               
- Misses           0       53       +53     
Flag Coverage Δ
unittests 39.77% <0.00%> (-60.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...dm_publisher/_demo/_demo_command_line_interface.py 0.00% <0.00%> (ø)
src/tqdm_publisher/_demo/_server.py 0.00% <0.00%> (ø)

@CodyCBakerPhD
Copy link
Member Author

@garrettmflynn I think this can be merged with your approval

I may still propose some follow-ups to adjust README and maybe add a new child class to the base that will make injection to downstream libraries simpler

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge (squash) March 11, 2024 18:34
Copy link
Collaborator

@garrettmflynn garrettmflynn left a comment

Choose a reason for hiding this comment

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

Sounds good! Thank you for your attention on this.

@CodyCBakerPhD CodyCBakerPhD merged commit 388d4be into main Mar 11, 2024
13 of 14 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the improve_demo branch March 11, 2024 18:52
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