Skip to content

Commit

Permalink
Next Amp Test and GH Actions Tweaks (#44)
Browse files Browse the repository at this point in the history
* update amplify code

* bevy 0/15 fixes

* small changes

* cache tweak

* ignore model downloads by default

* add tests to justfile

* split build and test
  • Loading branch information
zachcp authored Nov 15, 2024
1 parent 8904b9c commit 4d6a845
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 104 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,31 @@ on:
branches:
- "main"

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install ALSA development package
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev

- name: Configure cache
uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"

- name: Run Build
run: cargo build

- name: Run tests
run: cargo test --verbose
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ edition = "2021"
authors = ["Zach Charlop-Powers<[email protected]>"]
description = "Molecular visualization tools"
license = "MIT OR Apache-2.0"

[profile.dev]
# Disabling debug info speeds up builds a bunch,
# and we don't rely on it for debugging that much.
debug = 0
28 changes: 16 additions & 12 deletions ferritin-bevy/examples/basic_ballandstick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,26 @@ fn setup(mut commands: Commands) {
));

// Key Light
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
commands.spawn((
DirectionalLight {
color: Color::srgb(1.0, 0.9, 0.9),
illuminance: 10000.0,
shadows_enabled: true,
..default()
},
transform: Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
..default()
});
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
));

// Fill Light
commands.spawn( (
commands.spawn((
DirectionalLight {
color: Color::srgb(0.8, 0.8, 1.0),
illuminance: 5000.0,
shadows_enabled: false,
..default()
},
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)))
);
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)),
));

// Backlight
commands.spawn((
Expand All @@ -90,10 +89,13 @@ fn setup(mut commands: Commands) {
EulerRot::XYZ,
0.0,
std::f32::consts::PI,
0.0, ))));
0.0,
)),
));

// Add a light
commands.spawn(( PointLight {
commands.spawn((
PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
Expand All @@ -102,12 +104,14 @@ fn setup(mut commands: Commands) {
));

// Spotlight
commands.spawn(( SpotLight {
commands.spawn((
SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y)));
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y),
));
}
50 changes: 27 additions & 23 deletions ferritin-bevy/examples/basic_putty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,26 @@ fn setup(mut commands: Commands) {
));

// Key Light
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
commands.spawn((
DirectionalLight {
color: Color::srgb(1.0, 0.9, 0.9),
illuminance: 10000.0,
shadows_enabled: true,
..default()
},
transform: Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
..default()
});
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
));

// Fill Light
commands.spawn( (
commands.spawn((
DirectionalLight {
color: Color::srgb(0.8, 0.8, 1.0),
illuminance: 5000.0,
shadows_enabled: false,
..default()
},
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)))
);
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)),
));

// Backlight
commands.spawn((
Expand All @@ -90,24 +89,29 @@ fn setup(mut commands: Commands) {
EulerRot::XYZ,
0.0,
std::f32::consts::PI,
0.0, ))));
0.0,
)),
));

// Add a light
commands.spawn(( PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
commands.spawn((
PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
));

// Spotlight
commands.spawn(( SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y)));
commands.spawn((
SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y),
));
}
50 changes: 27 additions & 23 deletions ferritin-bevy/examples/basic_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,26 @@ fn setup(mut commands: Commands) {
));

// Key Light
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
commands.spawn((
DirectionalLight {
color: Color::srgb(1.0, 0.9, 0.9),
illuminance: 10000.0,
shadows_enabled: true,
..default()
},
transform: Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
..default()
});
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
));

// Fill Light
commands.spawn( (
commands.spawn((
DirectionalLight {
color: Color::srgb(0.8, 0.8, 1.0),
illuminance: 5000.0,
shadows_enabled: false,
..default()
},
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)))
);
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)),
));

// Backlight
commands.spawn((
Expand All @@ -123,24 +122,29 @@ fn setup(mut commands: Commands) {
EulerRot::XYZ,
0.0,
std::f32::consts::PI,
0.0, ))));
0.0,
)),
));

// Add a light
commands.spawn(( PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
commands.spawn((
PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
));

// Spotlight
commands.spawn(( SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y)));
commands.spawn((
SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y),
));
}
50 changes: 27 additions & 23 deletions ferritin-bevy/examples/basic_spheres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,26 @@ fn setup(mut commands: Commands) {
));

// Key Light
commands.spawn(DirectionalLightBundle {
directional_light: DirectionalLight {
commands.spawn((
DirectionalLight {
color: Color::srgb(1.0, 0.9, 0.9),
illuminance: 10000.0,
shadows_enabled: true,
..default()
},
transform: Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
..default()
});
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.5, 0.5, 0.0)),
));

// Fill Light
commands.spawn( (
commands.spawn((
DirectionalLight {
color: Color::srgb(0.8, 0.8, 1.0),
illuminance: 5000.0,
shadows_enabled: false,
..default()
},
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)))
);
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, 0.5, -0.5, 0.0)),
));

// Backlight
commands.spawn((
Expand All @@ -90,24 +89,29 @@ fn setup(mut commands: Commands) {
EulerRot::XYZ,
0.0,
std::f32::consts::PI,
0.0, ))));
0.0,
)),
));

// Add a light
commands.spawn(( PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
commands.spawn((
PointLight {
intensity: 1500.0,
shadows_enabled: true,
..default()
},
Transform::from_xyz(4.0, 8.0, 4.0),
));

// Spotlight
commands.spawn(( SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y)));
commands.spawn((
SpotLight {
intensity: 10000.0,
color: Color::srgb(0.8, 1.0, 0.8),
shadows_enabled: true,
outer_angle: 0.6,
..default()
},
Transform::from_xyz(-4.0, 5.0, -4.0).looking_at(Vec3::ZERO, Vec3::Y),
));
}
2 changes: 0 additions & 2 deletions ferritin-core/src/info/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ pub(crate) fn default_distance_range(a: &str, b: &str) -> (f32, f32) {
}
}

type BondInfo = (String, String, i32);

#[rustfmt::skip]
lazy_static! {
// amino acids from ccd
Expand Down
2 changes: 1 addition & 1 deletion ferritin-featurizers/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn execute(
Some(multi_pdb_config),
)?;

let model = exec.create_model();
let _model = exec.create_model();

// Predict
// model.predict()
Expand Down
Loading

0 comments on commit 4d6a845

Please sign in to comment.