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

[AEA-685] Gym connection fully async and full test coverage #1479

Merged
merged 3 commits into from
Jul 8, 2020

Conversation

solarw
Copy link
Contributor

@solarw solarw commented Jul 7, 2020

Proposed changes

improvements and better tests coverage for gym connection

Fixes

#1468

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease.
  • I have checked that the documentation about the aea cli tool works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules


self._queues = {} # type: Dict[str, asyncio.Queue]
self._queue: Optional[asyncio.Queue] = None
self._threaded_pool: ThreadPoolExecutor = ThreadPoolExecutor(10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for a high default of 10? Should also be declared as constant on top or be made configurable.

Comment on lines 145 to 146
if self._queue is None: # pragma: nocover
raise ValueError("Channel is not connected")
Copy link
Contributor

Choose a reason for hiding this comment

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

If you wrap self._queue in a property you can reduce some duplication of code..

Copy link
Contributor

@DavidMinarsch DavidMinarsch left a comment

Choose a reason for hiding this comment

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

LGTM, suggested some changes. There are also some failing tests related to the PR. Finally; please bump the version number of the connection and all its references.

@solarw solarw force-pushed the feature/gym_async_and_tests branch 5 times, most recently from 9203bac to 571f789 Compare July 7, 2020 09:57
@solarw solarw changed the title gym connection async and tests. [AEA-685] Gym connection fully async and full test coverage Jul 7, 2020
@solarw solarw force-pushed the feature/gym_async_and_tests branch from 571f789 to d8a35e2 Compare July 7, 2020 10:32
@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2020

Codecov Report

Merging #1479 into develop will decrease coverage by 1.42%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1479      +/-   ##
===========================================
- Coverage    89.57%   88.14%   -1.43%     
===========================================
  Files          242      242              
  Lines        17183    17188       +5     
===========================================
- Hits         15391    15150     -241     
- Misses        1792     2038     +246     
Flag Coverage Δ
#unittests 88.14% <100.00%> (-1.43%) ⬇️
Impacted Files Coverage Δ
packages/fetchai/connections/gym/connection.py 100.00% <100.00%> (+4.25%) ⬆️
packages/fetchai/connections/ledger/connection.py 32.43% <0.00%> (-58.11%) ⬇️
.../fetchai/connections/ledger/contract_dispatcher.py 34.52% <0.00%> (-51.20%) ⬇️
packages/fetchai/protocols/contract_api/message.py 39.24% <0.00%> (-48.11%) ⬇️
packages/fetchai/connections/ledger/base.py 52.54% <0.00%> (-42.38%) ⬇️
aea/contracts/ethereum.py 60.00% <0.00%> (-40.00%) ⬇️
aea/crypto/cosmos.py 68.42% <0.00%> (-31.58%) ⬇️
packages/fetchai/protocols/ledger_api/message.py 43.04% <0.00%> (-27.16%) ⬇️
...es/fetchai/connections/ledger/ledger_dispatcher.py 28.72% <0.00%> (-21.28%) ⬇️
...ges/fetchai/protocols/contract_api/custom_types.py 64.51% <0.00%> (-16.13%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5add1d2...79601d8. Read the comment docs.

@@ -8,7 +8,7 @@ aea_version: '>=0.5.0, <0.6.0'
fingerprint: {}
fingerprint_ignore_patterns: []
connections:
- fetchai/gym:0.3.0
- fetchai/gym:0.4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to bump the gym aea as a result

@solarw solarw force-pushed the feature/gym_async_and_tests branch from 4f02dc9 to 79601d8 Compare July 7, 2020 18:23
Copy link
Contributor

@DavidMinarsch DavidMinarsch left a comment

Choose a reason for hiding this comment

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

LGTM

@DavidMinarsch DavidMinarsch merged commit 23aa8d6 into develop Jul 8, 2020
@DavidMinarsch DavidMinarsch deleted the feature/gym_async_and_tests branch July 15, 2020 08:34
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