Skip to content
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

feat: martian-pipestance crate #412

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ martian-filetypes/example.bincode
martian-filetypes/example.json
martian-filetypes/example_lazy.bincode
martian-filetypes/example_lazy.json
.DS_Store
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline at end of file please.

59 changes: 59 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ members = [
"martian-derive",
"martian-lab",
"martian-filetypes",
]
"martian-pipestance",
]
19 changes: 19 additions & 0 deletions martian-pipestance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "martian-pipestance"
version = "0.1.0"
authors = ["Sreenath Krishnan <sreenath.krishnan@10xgenomics.com>"]
edition = "2021"
include = ["src/**/*"]
license = "MIT"

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

[dependencies]
serde = { version = "1.0", features = ['derive'] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be consistent about which quotes to use.

serde_json = "1.0"
anyhow = { version = "1", features = ["backtrace"] }
ordered-float = ">=3.7"
petgraph = { version = "0.6", default-features = false }

[dev-dependencies]
zstd = "0.12.4"
19 changes: 19 additions & 0 deletions martian-pipestance/src/common.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum NodeType {
Pipeline,
Stage,
}

#[cfg(test)]
pub fn read_zst(fname: &str) -> anyhow::Result<String> {
use anyhow::Context;
use std::io::Read;
let mut file = std::fs::File::open(fname).context(format!("While opening {fname}"))?;
let mut decoder = zstd::stream::read::Decoder::new(&mut file)?;
let mut buffer = String::new();
decoder.read_to_string(&mut buffer)?;
Ok(buffer)
}
Loading
Loading