Skip to content

Commit

Permalink
Change pyarrow version to allow use on Researcher Workbench
Browse files Browse the repository at this point in the history
  • Loading branch information
kvg committed Jan 19, 2024
1 parent 9d09fc8 commit 30d0851
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
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.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies = [
"polars",
"holoviews",
"datashader",
"pyarrow>=14.0.1",
"pyarrow",
"pyparsing"
]

Expand Down
9 changes: 0 additions & 9 deletions python/genomeshader/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,6 @@ def __str__(self):
f' - genome_build: {self.genome_build}\n'
)

def get_version(self):
"""
This function returns the version of the library.
Returns:
str: The version of the library.
"""
return self._session.version()

def get_session_name(self):
"""
This function returns the name of the current session.
Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,26 @@ impl Session {
println!(" - {}:{}-{} : {:?}", l_fmt.0, l_fmt.1, l_fmt.2, p);
}
}

fn version(&self) -> PyResult<String> {
Ok(env!("CARGO_PKG_VERSION").to_string())
}
}

#[pyfunction]
fn _init() -> PyResult<Session> {
Ok(Session::new())
}

#[pyfunction]
fn version() -> PyResult<String> {
Ok(env!("CARGO_PKG_VERSION").to_string())
}

/// A Python module implemented in Rust. The name of this function must match
/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
/// import the module.
#[pymodule]
fn genomeshader(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(_gcs_list_files_of_type, m)?)?;
m.add_function(wrap_pyfunction!(_init, m)?)?;
m.add_function(wrap_pyfunction!(version, m)?)?;

Ok(())
}

0 comments on commit 30d0851

Please sign in to comment.