numerapi 2.23.0.dev2__py3-none-any.whl → 2.23.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
numerapi/__init__.py CHANGED
@@ -3,9 +3,9 @@
3
3
  from importlib.metadata import version, PackageNotFoundError
4
4
 
5
5
  try:
6
- __version__ = version("package-name")
6
+ __version__ = version("numerapi")
7
7
  except PackageNotFoundError:
8
- __version__ = 'unknown'
8
+ __version__ = "unknown"
9
9
 
10
10
 
11
11
  # pylint: disable=wrong-import-position
numerapi/base_api.py CHANGED
@@ -620,6 +620,79 @@ class Api:
620
620
  round_num = data["number"]
621
621
  return round_num
622
622
 
623
+ def list_rounds(
624
+ self,
625
+ number: int | None = None,
626
+ target: str | None = None,
627
+ status: str | None = None,
628
+ limit: int | None = None,
629
+ ) -> List[Dict]:
630
+ """List rounds with the filters supported by the round resolver.
631
+
632
+ Args:
633
+ number (int, optional): round number filter
634
+ target (str, optional): round target filter
635
+ status (str, optional): round status filter. One of `upcoming`,
636
+ `open`, `resolving`, or `resolved`
637
+ limit (int, optional): maximum number of rounds to return
638
+
639
+ Returns:
640
+ list of dicts: round entries matching the provided filters
641
+ """
642
+ query = """
643
+ query($tournament: Int
644
+ $number: Int
645
+ $target: String
646
+ $status: RoundStatus
647
+ $limit: Int) {
648
+ rounds(tournament: $tournament
649
+ number: $number
650
+ target: $target
651
+ status: $status
652
+ limit: $limit) {
653
+ id
654
+ tournament
655
+ number
656
+ target
657
+ closeTime
658
+ closeStakingTime
659
+ openTime
660
+ scoreTime
661
+ resolveTime
662
+ resolvedGeneral
663
+ resolvedStaking
664
+ payoutFactor
665
+ stakeThreshold
666
+ minCorrMultiplier
667
+ maxCorrMultiplier
668
+ defaultCorrMultiplier
669
+ minMmcMultiplier
670
+ maxMmcMultiplier
671
+ defaultMmcMultiplier
672
+ dataDatestamp
673
+ }
674
+ }
675
+ """
676
+ arguments = {
677
+ "tournament": self.tournament_id,
678
+ "number": number,
679
+ "target": target,
680
+ "status": None if status is None else status.upper(),
681
+ "limit": limit,
682
+ }
683
+ rounds = self.raw_query(query, arguments)["data"]["rounds"]
684
+ for round_info in rounds:
685
+ for field in [
686
+ "closeTime",
687
+ "closeStakingTime",
688
+ "openTime",
689
+ "scoreTime",
690
+ "resolveTime",
691
+ ]:
692
+ utils.replace(round_info, field, utils.parse_datetime_string)
693
+ utils.replace(round_info, "payoutFactor", utils.parse_float_string)
694
+ return rounds
695
+
623
696
  def set_bio(self, model_id: str, bio: str) -> bool:
624
697
  """Set bio field for a model id.
625
698
 
@@ -1054,7 +1127,6 @@ class Api:
1054
1127
  version: str | None = None,
1055
1128
  day: int | None = None,
1056
1129
  resolved: bool | None = None,
1057
- tournament: int | None = None,
1058
1130
  last_n_rounds: int | None = None,
1059
1131
  distinct_on_round: bool | None = None,
1060
1132
  ) -> List[Dict]:
@@ -1116,7 +1188,7 @@ class Api:
1116
1188
  "version": version,
1117
1189
  "day": day,
1118
1190
  "resolved": resolved,
1119
- "tournament": self.tournament_id if tournament is None else tournament,
1191
+ "tournament": self.tournament_id,
1120
1192
  "lastNRounds": last_n_rounds,
1121
1193
  "distinctOnRound": distinct_on_round,
1122
1194
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numerapi
3
- Version: 2.23.0.dev2
3
+ Version: 2.23.1
4
4
  Summary: Automatically download and upload data for the Numerai machine learning competition
5
5
  Home-page: https://github.com/uuazed/numerapi
6
6
  Maintainer: uuazed
@@ -0,0 +1,14 @@
1
+ numerapi/__init__.py,sha256=15Ba_Ma1HCBVmSpTBbI-tjNGbfJUo2jagm5r7o2amT8,445
2
+ numerapi/base_api.py,sha256=StASiaw3rX6RzV4uAkM3QEsPxF24LupwWgmKde9IIJ4,73357
3
+ numerapi/cli.py,sha256=oaATypyxS0mlW2Uouby6Srq0DxWkouBg63uiXJY-QHM,8206
4
+ numerapi/cryptoapi.py,sha256=J9fAEhiaEfpvRCiDsSJz8rlazKD-4nkJRJ85f09jGp0,1502
5
+ numerapi/numerapi.py,sha256=cyTpNGRKr4BqK2jKA2Rj540tjyykpV3axz-6jLm1Flo,12323
6
+ numerapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ numerapi/signalsapi.py,sha256=inKwMvuIWNGcDFzzdhqRO1RIms_qz1d7lkwA2dzvAoQ,10188
8
+ numerapi/utils.py,sha256=YgXujHyE1TLTf5v1pspcVAX89SQI3Zl3vMcbNlHZJDs,4688
9
+ numerapi-2.23.1.dist-info/licenses/LICENSE,sha256=BnOIJOdxTIxmbNPf_ZmCXqepXDTRWad1nQf9eYk-eSg,1056
10
+ numerapi-2.23.1.dist-info/METADATA,sha256=gNRc6nbGSj1vmPrKOGH7KSHVVwXHdPHjhccMHKrGk-U,7036
11
+ numerapi-2.23.1.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
12
+ numerapi-2.23.1.dist-info/entry_points.txt,sha256=P7RHLytfftNPE14vRxml52-UEkyuAviRegWTID4a_ig,46
13
+ numerapi-2.23.1.dist-info/top_level.txt,sha256=7f4lKNQqRDEGaDXGIqRQCx-rU5pNl6ZgbXz864F1uXY,9
14
+ numerapi-2.23.1.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- numerapi/__init__.py,sha256=okDA4NGjUj1Q8bDJg4T1t0LTf_S3GPbXCdw8gla7_VU,449
2
- numerapi/base_api.py,sha256=Q--49pamMwgb7AM98JC3gVS4K7k2xE7lmf6mtIwk3lc,71010
3
- numerapi/cli.py,sha256=oaATypyxS0mlW2Uouby6Srq0DxWkouBg63uiXJY-QHM,8206
4
- numerapi/cryptoapi.py,sha256=J9fAEhiaEfpvRCiDsSJz8rlazKD-4nkJRJ85f09jGp0,1502
5
- numerapi/numerapi.py,sha256=cyTpNGRKr4BqK2jKA2Rj540tjyykpV3axz-6jLm1Flo,12323
6
- numerapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- numerapi/signalsapi.py,sha256=inKwMvuIWNGcDFzzdhqRO1RIms_qz1d7lkwA2dzvAoQ,10188
8
- numerapi/utils.py,sha256=YgXujHyE1TLTf5v1pspcVAX89SQI3Zl3vMcbNlHZJDs,4688
9
- numerapi-2.23.0.dev2.dist-info/licenses/LICENSE,sha256=BnOIJOdxTIxmbNPf_ZmCXqepXDTRWad1nQf9eYk-eSg,1056
10
- numerapi-2.23.0.dev2.dist-info/METADATA,sha256=RtntW1DNgRIHzPTY19VrpNWOoo-XJmkm4jHBlhmKx74,7041
11
- numerapi-2.23.0.dev2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
12
- numerapi-2.23.0.dev2.dist-info/entry_points.txt,sha256=P7RHLytfftNPE14vRxml52-UEkyuAviRegWTID4a_ig,46
13
- numerapi-2.23.0.dev2.dist-info/top_level.txt,sha256=7f4lKNQqRDEGaDXGIqRQCx-rU5pNl6ZgbXz864F1uXY,9
14
- numerapi-2.23.0.dev2.dist-info/RECORD,,