-
Notifications
You must be signed in to change notification settings - Fork 4
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
v0.1.2: new core #24
Merged
Merged
v0.1.2: new core #24
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- commented out WIP tests - fixed generics ordering
xoolive
reviewed
Jun 16, 2024
The rewrite is now complete, the core now supports three major services ( async def main() -> None:
async with FR24() as fr24:
# download livefeed of entire world
response = await fr24.livefeed.fetch() # {ctx: {...}, data: list[dict]}
datac = response.to_arrow() # {ctx: {...}, data: pa.Table}
datac.save() # saves to ~/.cache/fr24/livefeed/{timestamp}.parquet, determined from .ctx
datac_disk = fr24.livefeed.load(timestamp) # reads data from cache and builds ctx
# download and save trajectory for one flight
response = await fr24.playback.fetch(0x2FB3041).to_arrow().save()
datac_disk = fr24.playback.load(0x2FB3041)
print(datac_disk.metadata) # accesses metadata stored in arrow schema
# iteratively upsert pages of flight list to an existing arrow table
data = fr24.flight_list.load(reg="B-HPB")
async for response in fr24.flight_list.fetch_all(reg="B-HPB"):
data_new = response.to_arrow()
data.concat(data_new, inplace=True)
data.save()
await main() Documentation and tests are also updated for the new core. Some details:
|
Hi @cathaypacific8747 will do |
xoolive
reviewed
Jun 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tried the text user interface, and it's still working 🥳
Deploying flightradar24 with
|
Latest commit: |
3edf447
|
Status: | ✅ Deploy successful! |
Preview URL: | https://8cc46558.flightradar24.pages.dev |
Branch Preview URL: | https://new-core.flightradar24.pages.dev |
- modify core: raise runtimeerror when schema does not match
- feat(core): enable saving to `IO`
f2878bc
to
225aeb6
Compare
- `flight_list_df`: times are now ms instead of ns, `flight_id` and `icao24` no longer floats - `playback_df`: `ems` and metadata now serialised
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current core is quite cumbersome to use:
It is unclear where data is actually stored. It would be ideal to have something like:
__aenter__
Things to implement for the new core:
.flight_list.fetch_all()
.playback.*
.livefeed.*
.find.*
.schema.metadata