Skip to content

Commit

Permalink
Release preparation (#140)
Browse files Browse the repository at this point in the history
* Cleanup Cargo.toml files

* Update Python typings
  • Loading branch information
helgee authored Jul 19, 2024
1 parent bdf7cc0 commit 5e0494d
Show file tree
Hide file tree
Showing 14 changed files with 214 additions and 146 deletions.
6 changes: 5 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["tools/lox-gen"]
resolver = "2"

[workspace.package]
rust-version = "1.70"
rust-version = "1.74"
edition = "2021"
license = "MPL-2.0"
authors = ["Helge Eichhorn and the lox-space contributors"]
Expand All @@ -18,7 +18,7 @@ lox-orbits = { path = "crates/lox-orbits" }
lox-space = { path = "crates/lox-space" }
lox-time = { path = "crates/lox-time" }
lox-utils = { path = "crates/lox-utils" }
lox-derive = { path = "./crates/lox-derive" }
lox-derive = { path = "crates/lox-derive" }

csv = "1.3.0"
divan = "0.1.14"
Expand Down
5 changes: 4 additions & 1 deletion crates/lox-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "lox-derive"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true

[lib]
proc-macro = true
Expand Down
2 changes: 0 additions & 2 deletions crates/lox-earth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ edition.workspace = true
license.workspace = true
authors.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lox-bodies.workspace = true
lox-io.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/lox-ephem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ edition.workspace = true
license.workspace = true
authors.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
nom.workspace = true
lox-utils.workspace = true
7 changes: 3 additions & 4 deletions crates/lox-io/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "lox-io"
version = "0.0.0"

authors.workspace = true
version = "0.1.0"
rust-version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
authors.workspace = true

[dependencies]
lox-utils.workspace = true
Expand Down
7 changes: 7 additions & 0 deletions crates/lox-orbits/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ impl<T: TimeLike> Window<T> {
pub fn end(&self) -> &T {
&self.end
}

pub fn duration(&self) -> TimeDelta
where
T: Clone,
{
self.end.clone() - self.start.clone()
}
}

pub fn find_windows<F: Fn(f64) -> f64 + Copy, T: TimeLike + Clone, R: FindBracketedRoot<F>>(
Expand Down
9 changes: 7 additions & 2 deletions crates/lox-orbits/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ pub enum PyFrame {
#[pymethods]
impl PyFrame {
#[new]
fn new(name: &str) -> PyResult<Self> {
name.parse()
fn new(abbreviation: &str) -> PyResult<Self> {
abbreviation.parse()
}

fn __getnewargs__(&self) -> (String,) {
(self.abbreviation(),)
}
Expand Down Expand Up @@ -645,6 +646,10 @@ impl PyWindow {
fn end(&self) -> PyTime {
self.0.end().clone()
}

fn duration(&self) -> PyTimeDelta {
PyTimeDelta(self.0.duration())
}
}

#[pyclass(name = "Vallado", module = "lox_space", frozen)]
Expand Down
5 changes: 2 additions & 3 deletions crates/lox-space/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[package]
name = "lox-space"
version = "0.1.0"

authors.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
authors.workspace = true

[lib]
name = "lox_space"
Expand Down
Loading

0 comments on commit 5e0494d

Please sign in to comment.