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

Fix#400: Re-merge YAML & CLI #403

Merged
merged 189 commits into from
Jan 16, 2024
Merged

Fix#400: Re-merge YAML & CLI #403

merged 189 commits into from
Jan 16, 2024

Conversation

trentmc
Copy link
Member

@trentmc trentmc commented Nov 27, 2023

Fixes #400

Things done so far:

  • merge in both original YAML-CLI commits into the branch (b46cd81 and 40a478b)
  • Update entrypoint script to use pdr cli #405
  • Add traction plots. Via merge from issue388-refactor-csvs-pandas, plus many changes. Commit.
  • Fix #408: test_sim_engine failing in yaml-cli2, bc hist_df is s not ms. It should be ms.
  • Fix #414: Split data_factory into two
  • More README docs on barge. Incl (a) barge-calls.md: how pdr-backend and barge interact, and (b) barge as part of release process.
  • Clean up how dfbuyer/predictoor/trader agents get feeds. In subgraph.py::query_feed_contracts(), output Dict[Feed], not Dict[feed_dict]. Generally, deprecate feed_dict in lieu of Feed. Commit 720aa64.
  • In many tests using barge, replace with much faster mocks. 5b19f0b
  • Consolidate gas pricing into tx_gas_price(), and call_params into 'tx_call_params()`. Commit c9bbf41 and d1eea21
  • Fix "Publisher error "You must set RPC_URL environment variable" #437. Incl commit (5362ac2)
  • add to_wei(), 'from_wei()` utility (in mathutil.py)
  • improve predictoor logging UX: less verbose, more informative. Commit 5524b1f
  • improve DX, UX, testing of predictoor_contract.py, fixed_rate.py. Move utility functions out of predictoor_contract.py into appropriate utility modules (networkutil, etc)
  • rename trader_agent.py -> base_trader_agent.py, TraderAgent -> BaseTraderAgent
  • in data_eng: Rename parquet_dfs -> rawohlcv_dfs; hist_df -> mergedohlcv_df. Commit 4460259
  • refactor test_ohlcv_data_factory: cleanup mocks; remove redundant test

idiom-bytes and others added 29 commits November 21, 2023 23:18
…_df() to verify that its working as intended. I believe kraken data is returning null at the moment.
* Towards #232: Refactoring towards ppss.yaml part 3/3
* move everything in model_eng/ to data_eng/
* Fix #352: [SW eng] High DRY violation in test_predictoor_agent.py <> test_predictoor_agent3.py
* Deprecate backend-dev.md (long obsolete), macos.md (obsolete due to vps), and envvars.md (obsolete because of ppss.yaml).
* Rename BaseConfig to web3_pp.py and make it yaml-based
* Move scripts into util/, incorporate them into pdr cli, some refactoring.
* revamp READMEs for cli. And, tighten up text for getting OCEAN & ROSE
* Deprecated ADDRESS_FILE and RPC_URL envvars.
* deprecate Predictoor approach 2. Pita to maintain 


Co-authored-by: trizin <[email protected]>
* Update check script CI

* Update cron topup

* Workflow dispatch

* Nevermind, revert previous commit

* Run on push to test

* Pass ppss.web3_pp instead of web3_config

* Don't run on push
* Add main.py back

* Black

* Linter

* Linter

* Remove "switch back to version v0.1.1"

* Black
calina-c and others added 28 commits December 29, 2023 21:38
* Split aimodel and lake ss.
* Split data ss tests.
* Add aimodel ss into predictoor ss.
* Remove stray data_ss.
* Moves test_n to sim ss.
* Trader ss to use own feed instead of data pp.
* Remove data pp entirely.
* Correct ohlcv data factory.
* Add timeframe into arg feeds.
* Refine and add tests for timeframe in arg feed.
* Remove timeframe dependency in trader and predictoor.
* Remove timeframe from lake ss keys.
* Singleify trader agents.
* Adds lake command, assert timeframe in lake (needed for columns).
* Process all signals in lake.
* first commit for subscriptions

* hook up pdr_subscriptions to gql_factory

* Tests passing, expanding tests to support multiple tables

* Adding tests and improving handling of empty parquet files

* Subscriptions test

* Updating logic to use predictSubscriptions, take lastPriceValue, and to not query the subgraph more than needed.

* Moving models from contract/ -> subgraph/

* Fixing pylint

* fixing tests

* adding @enforce_types
* Improve DRY in cli module.
* Add common functionality to single and multifeed entries.
* Remove trader pp and move necessary lines into trader ss.
* Adds dfbuyer filtering.
* Remove exchange dict from multifeed mixin.
* Replace name of predict_feed.
* Add base_ss tests.
* Adds trueval filtering.
* Adds a line of coverage to test.
* Add coverage for csvs module.
* Add coverage to check_network.
* Add coverage to predictions and traction info.
* Adds coverage to predictoor stats.
* Adds full coverage to arg cli classes.
* Adds cli arguments coverage and fix a wrong parameter in cli arguments.
* Adds coverage to cli module and timeframe.
* Some reformats and coverage in contract module.
* Adds coverage and simplifications to contracts, except token.
* Add some coverage to tokens to complete contract coverage work.
…t match (PR #510)

* Refactor: new function clean_raw_ohlcv() that moves code from _update_rawohlcv_files_at_feed(). It has sub-functions with precise responsibilities. It has tests.
* Add more tests for merge_raw_ohlcv_dfs, including one that replicates the original issue
* Fix the core bug, now the new tests pass. The main fix is at the top of merge_df::_add_df_col()
* Fix failing test due to network override. NOTE: this may have caused the remaining pytest error. Will fix that after this merge
… (PR #518)

Fixes #517

Root cause: ppss.yaml's aimodel_ss feeds section didn't have eg "c" or "ohlcv"; it assumed that they didn't need to be specified. This was an incorrect assumption: aimodel_ss needs it. In fact aimodel_ss class supports these signals, but the yaml file didn't have it.

What this PR does:
- add a test to aimodel_ss class constructor that complains if not specified
- do specify signals in the ppss.yaml file

Note: the PR pytest failed, but for an unrelated reason. Just created #520 for follow-up.
* Adds some coverage to dfbuyer agent.
* Add dfbuyer and ppss coverage.
* Adds predictoor and sim coverage.
* Adds coverage to util.
* Add some trueval coverage.
* Adds coverage to trader agents.
* Add coverage to portfolio.
* Add coverage to subgraph consume_so_far and fix an infinite loop bug.
* More subgraph coverage.
…close (#524)

Fix #519

Changes:
- do check for dependencies among various ppss ss feeds
- if any of those checks fails, give a user-friendly error message
  - greatly improved printing of ArgFeeds, including merging across pairs and signals. This was half the change of this PR
- appropriate unit tests
* Print texts: dftool -> pdrcli

* pdrcli -> pdr
* Make missing attributes message more friendly and integrate ai ss part to multimixin.
How fixed: use previous ascynio version.

Calina: Asyncio has some known issues, per their changelog. Namely issues with fixture handling etc., which I believe causes the warnings and test skips in our runs. They recommend using the previous version until they are fixed. It is also why my setup didn't spew up any warnings, my asyncio version was 21.1.

https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html
* Fix web3_config.rpc_url in test_send_encrypted_tx

* Add conftest.py for system tests

* Add system test for get_traction_info

* Add system test for get_predictions_info

* Add system test for get_predictoors_info

* Add "PDRS" argument to _ArgParser_ST_END_PQDIR_NETWORK_PPSS_PDRS class

* Fix feed.exchange type conversion in publish_assets.py

* Add print statement for payout completion

* Add system level test for pdr topup

* Add conditional break for testing via env

* Add conditional break for testing via env

* Black

* Add test for pdr rose payout system

* System level test pdr check network

* System level test pdr claim OCEAN

* System level test pdr trueval agent

* Remove unused patchs

* Fix wrong import position in conftest.py

* Remove unused imports

* System level test for pdr dfbuyer

* System level tests for pdr trader

* System level tests for publisher

* Rename publisher test file

* Add conditional break in take_step() method

* Update dftool->pdr names in system tests

* Refactor test_trader_agent_system.py

* Add mock fixtures for SubgraphFeed and PredictoorContract

* Add system tests for predictoor

* Black

* Refactor system test files - linter fixes

* Linter fixes

* Black

* Add missing mock

* Add savefig assertion in test_topup

* Update VPS configuration to use development entry

* Patch verify_feed_dependencies

* Refactor test_predictoor_system.py to use a common test function

* Refactor trader approach tests to improve DRY

* Black

* Indent

* Ditch NETWORK_OVERRIDE

* Black

* Remove unused imports
* Add publisher feeds filtering.
* Use current time in seconds utc

* Remove unused import

* Fix the check_network test

* Divide current_ut by 1000

* test_check_network_without_mock, WIP

* Add missing import

* Implement current_ut_s

* Use current_ut_s

* Update tests

* Formatting

* Return int

* Remove balanceOf assert

* Remove unused import

* current_ut -> current_ut_ms
…541)

* GH workflow: Fetch the address file and move it to contracts directory

* Fetch and move the address file to address dir
@trizin trizin merged commit 3544c73 into main Jan 16, 2024
4 checks passed
@trizin trizin deleted the yaml-cli2 branch January 16, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants