-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from seatonullberg/dev
v0.3.0
- Loading branch information
Showing
222 changed files
with
22,511 additions
and
447 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "velvet" | ||
version = "0.2.1" | ||
version = "0.3.0" | ||
authors = ["Seaton Ullberg <[email protected]>"] | ||
edition = "2018" | ||
repository = "https://github.com/seatonullberg/velvet" | ||
|
@@ -19,17 +19,18 @@ categories = [ | |
|
||
[workspace] | ||
members = [ | ||
"crates/app", | ||
"crates/cli", | ||
"crates/convert", | ||
"crates/core", | ||
"crates/test-utils", | ||
] | ||
|
||
[dependencies] | ||
velvet-convert = { path = "crates/convert", version = "0.1.0" } | ||
velvet-core = { path = "crates/core", version = "0.2.1" } | ||
velvet-convert = { path = "crates/convert", version = "0.1.2" } | ||
velvet-core = { path = "crates/core", version = "0.3.1" } | ||
|
||
[dev-dependencies] | ||
indicatif = "0.15" | ||
hdf5 = "0.7" | ||
log = "0.4" | ||
plotters = "0.3.0" | ||
pretty_env_logger = "0.4" | ||
pretty_env_logger = "0.4" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
name = "velvet-cli" | ||
version = "0.1.1" | ||
authors = ["Seaton Ullberg <[email protected]>"] | ||
description = "Command line tool built on top of the Velvet API" | ||
license = "MIT" | ||
repository = "https://github.com/seatonullberg/velvet" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
clap = "2.33" | ||
ron = "0.6" | ||
velvet-convert = { path = "../convert", version = "0.1.2" } | ||
velvet-core = { path = "../core", version = "0.3.0" } | ||
|
||
[[bin]] | ||
name = "velvet" | ||
path = "src/main.rs" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
use std::fs::File; | ||
use std::io::prelude::*; | ||
use std::io::BufReader; | ||
|
||
use clap::{arg_enum, value_t, App, Arg, ArgMatches, SubCommand}; | ||
use ron::ser::{to_string_pretty, PrettyConfig}; | ||
|
||
use velvet_convert::poscar::load_poscar; | ||
|
||
arg_enum! { | ||
#[derive(PartialEq, Debug)] | ||
pub enum FileFormat { | ||
Poscar, | ||
} | ||
} | ||
|
||
fn main() { | ||
let matches = App::new("Velvet CLI") | ||
.version("0.1.0") | ||
.author("Seaton Ullberg <[email protected]>") | ||
.about("Command line tool built on top of the Velvet API") | ||
.subcommand( | ||
SubCommand::with_name("convert") | ||
.about("convert external data formats into Velvet's internal format") | ||
.arg( | ||
Arg::with_name("src") | ||
.index(1) | ||
.takes_value(true) | ||
.required(true) | ||
.help("source filepath"), | ||
) | ||
.arg( | ||
Arg::with_name("dst") | ||
.index(2) | ||
.takes_value(true) | ||
.required(true) | ||
.help("destination filepath"), | ||
) | ||
.arg( | ||
Arg::with_name("format") | ||
.short("f") | ||
.long("format") | ||
.takes_value(true) | ||
.possible_values(&FileFormat::variants()) | ||
.case_insensitive(true), | ||
), | ||
) | ||
.get_matches(); | ||
|
||
if let Some(matches) = matches.subcommand_matches("convert") { | ||
handle_convert(matches) | ||
} | ||
} | ||
|
||
fn handle_convert(matches: &ArgMatches) { | ||
let file = File::open(matches.value_of("src").unwrap()).unwrap(); | ||
let buf = BufReader::new(file); | ||
let fmt = value_t!(matches, "format", FileFormat).unwrap(); | ||
let system = match fmt { | ||
FileFormat::Poscar => load_poscar(buf), | ||
}; | ||
let pretty = PrettyConfig::new().with_decimal_floats(true); | ||
let res = to_string_pretty(&system, pretty).unwrap(); | ||
let mut file = File::create(matches.value_of("dst").unwrap()).unwrap(); | ||
file.write_all(res.as_bytes()).unwrap(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "velvet-convert" | ||
version = "0.1.0" | ||
version = "0.1.2" | ||
authors = ["Seaton Ullberg <[email protected]>"] | ||
description = "Convert external file formats into Velvet data structures." | ||
license = "MIT" | ||
|
@@ -10,4 +10,4 @@ edition = "2018" | |
[dependencies] | ||
nalgebra = "0.23" | ||
vasp-poscar = "0.3.2" | ||
velvet-core = { path = "../core", version = "0.2.1" } | ||
velvet-core = { path = "../core", version = "0.3.0" } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
//! Convert external file formats into Velvet data structures. | ||
mod poscar; | ||
pub use poscar::load_poscar; | ||
pub mod poscar; | ||
|
||
pub mod prelude { | ||
pub use super::poscar::*; | ||
} | ||
|
||
#[allow(dead_code)] | ||
fn test_resources_path(filename: &str) -> String { | ||
format!( | ||
"{}/../../resources/test/{}", | ||
env!("CARGO_MANIFEST_DIR"), | ||
filename | ||
) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
[package] | ||
name = "velvet-core" | ||
version = "0.2.1" | ||
version = "0.3.1" | ||
authors = ["Seaton Ullberg <[email protected]>"] | ||
description = "Core feature library for the Velvet simulation engine." | ||
license = "MIT" | ||
repository = "https://github.com/seatonullberg/velvet" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
hdf5 = "0.7" | ||
indicatif = "0.15" | ||
log = "0.4" | ||
nalgebra = {version = "0.23", features = ["serde-serialize"]} | ||
rand = "0.7" | ||
pretty_env_logger = "0.4" | ||
rand = {version = "0.7", features = ["serde1"] } | ||
rand_distr = "0.3" | ||
ron = "0.6" | ||
serde = {version = "1.0", features = ["derive"]} | ||
strum = "0.20" | ||
strum_macros = "0.20" | ||
|
@@ -20,7 +23,9 @@ typetag = "0.1.6" | |
[dev-dependencies] | ||
approx = "0.4" | ||
criterion = "0.3" | ||
velvet-convert = { path = "../convert" } | ||
ron = "0.6" | ||
test-utils = { path = "../test-utils" } | ||
velvet-convert = { path = "../convert", version = "0.1.2" } | ||
|
||
[[bench]] | ||
name = "integrator-benchmarks" | ||
|
@@ -35,4 +40,9 @@ harness = false | |
[[bench]] | ||
name = "thermostat-benchmarks" | ||
path = "benches/thermostats.rs" | ||
harness = false | ||
harness = false | ||
|
||
[[bench]] | ||
name = "pair-potential-benchmarks" | ||
path = "benches/potentials/pair.rs" | ||
harness = false |
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
Oops, something went wrong.