-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rewrite #62
Comments
cathaypacific8747
added a commit
that referenced
this issue
Dec 18, 2024
- fix: broken numpy docs in python files - collapse `rst` api references to single index md - style: fix test E501 - ci: update joss, paper - remove: forge `environment.yml` (deprecate conda) - remove: `MANIFEST.in` (replaced with hatchling)
cathaypacific8747
added a commit
that referenced
this issue
Dec 20, 2024
- original code largely intact. only adding types to check for logic errors. - fix: explicitly use uint16 for enums - fix: `end_time` -> `duration_s` - fix: `global_time` should be `seconds_since_start` - rename: `traffic.ap` -> `traffic.autopilot` - rename: `ConvertHistoricDemo` time -> timestamps - fix misc logic errors - chore: properly run ruff, mypy and tests with uv
Draft
ec51a70 introduces a new MIT-licensed The goal is to allow functions to accept not only NumPy arrays, but anything that conforms to the Array API, so we can do things like: import jax
import jax.numpy as jnp
from airtrafficsim.experimental.geospatial import G_0
from airtrafficsim.experimental.performance.bada3 import atmosphere
from airtrafficsim.experimental.thermodynamics import R_SPECIFIC_DRY_AIR
"""
Test that the BADA3 atmosphere model can be differentiated with JAX,
and that it is under hydrostatic equilibrium.
"""
zs = jnp.linspace(0, 20000, 100)
dpdz = jax.vmap(
jax.grad(lambda z: atmosphere(z, delta_temperature=0.0).pressure)
)(zs)
rho = atmosphere(zs, delta_temperature=0.0).density(R_SPECIFIC_DRY_AIR)
assert jnp.allclose(dpdz, -rho * G_0) |
f0256ec introduces support for the import polars as pl
import numpy as np
from airtrafficsim.experimental.performance.bada3 import atmosphere
def calc_atmosphere(z: pl.Expr) -> tuple[pl.Expr, pl.Expr, pl.Expr]:
res = atmosphere(z, delta_temperature=0.0)
return (
z,
res.pressure.alias("pressure"),
res.temperature.alias("temperature"),
)
DATA = {
"z": np.linspace(0, 20000, 50),
# ... more data
}
lf = pl.DataFrame(DATA).lazy()
query = lf.select(calc_atmosphere(pl.col("z")))
print(query.explain())
print(query.collect()) Output
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are rewriting the project to be more modular and typed. Since there will be significant breaking changes, commits will be added in the dev branch and merged into master once stabilised.
todo:
uv
(modern package manager)web
andera5
optional dependenciesruff
(linting)mkdocs
mypy
replace staticmethods in*Calculation
,Unit
,Nav
to pure functions*Performance
should not storeBada
split god objects*fastapi
debugging much easier)
conda
yarn
tonpm
* will be addressed in the
experimental
modulenon-goals:
some notes:
Traffic
,Autopilot
)Environment
responsible for many tasks: simulation, socket IO, file IO.Aircraft
doesn't hold its own data, but acts as a pointer/slice to the arrays insideTraffic
Traffic.del_aircraft()
is calledrun_simulation
signalThe text was updated successfully, but these errors were encountered: