Skip to content

Commit

Permalink
Update for namechange
Browse files Browse the repository at this point in the history
  • Loading branch information
mhovd committed Feb 10, 2024
1 parent aa8c13b commit dcee75f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
cargo-run:
runs-on: self-hosted
env:
NPCORE_CONFIG_TUI: false # Disable TUI
PMCORE_CONFIG_TUI: false # Disable TUI
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ copy of the Program in return for a fee.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

NPcore Copyright (C) 2023 J. Otálvaro, M. Neely, LAPKB
PMcore Copyright (C) 2023 J. Otálvaro, M. Neely, LAPKB
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
6 changes: 3 additions & 3 deletions src/entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ where
Ok(())
}

/// Primary entrypoint for NPcore
/// Primary entrypoint for PMcore
///
/// This function is the primary entrypoint for NPcore, and is used to run the algorithm.
/// This function is the primary entrypoint for PMcore, and is used to run the algorithm.
/// The settings for this function is specified in a TOML configuration file, see `routines::settings::run` for details.
pub fn start<S>(engine: Engine<S>, settings_path: String) -> Result<NPResult>
where
Expand All @@ -98,7 +98,7 @@ where
let (tx, rx) = mpsc::unbounded_channel::<Comm>();
let maintx = tx.clone();
logger::setup_log(&settings, tx.clone());
tracing::info!("Starting NPcore");
tracing::info!("Starting PMcore");

// Read input data and remove excluded scenarios (if any)
let mut scenarios = datafile::parse(&settings.paths.data).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! NPcore is a framework for developing and running non-parametric algorithms for population pharmacokinetic modelling
//! PMcore is a framework for developing and running non-parametric algorithms for population pharmacokinetic modelling
pub mod algorithms;
pub mod routines {
Expand Down
2 changes: 1 addition & 1 deletion src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn setup_log(settings: &Settings, ui_tx: UnboundedSender<Comm>) {
// Use the log level defined in configuration file, or default to info
let log_level = settings.config.log_level.as_str();

// Use the log file defined in configuration file, or default to npcore.log
// Use the log file defined in configuration file, or default to pmcore.log
let log_path = settings.paths.log.as_ref().unwrap();

let env_filter = EnvFilter::new(&log_level);
Expand Down
8 changes: 4 additions & 4 deletions src/routines/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use serde_derive::Serialize;
use serde_json;
use std::collections::HashMap;

/// Contains all settings NPcore
/// Contains all settings PMcore
#[derive(Debug, Deserialize, Clone, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Settings {
Expand All @@ -26,7 +26,7 @@ pub struct Paths {
pub data: String,
/// If provided, the log file will be written to this path.
pub log: Option<String>,
/// If provided, NPcore will use this prior instead of a "uniform" prior, see `sobol::generate` for details.
/// If provided, PMcore will use this prior instead of a "uniform" prior, see `sobol::generate` for details.
pub prior: Option<String>,
}

Expand Down Expand Up @@ -160,13 +160,13 @@ impl Error {
///
/// This function parses the settings from a TOML configuration file. The settings are validated, and a copy of the settings is written to file.
///
/// Entries in the TOML file may be overridden by environment variables. The environment variables must be prefixed with `NPCORE_`, and the TOML entry must be in uppercase. For example, the TUI may be disabled by setting the environment variable `NPCORE_TUI=false`.
/// Entries in the TOML file may be overridden by environment variables. The environment variables must be prefixed with `PMCORE_`, and the TOML entry must be in uppercase. For example, the TUI may be disabled by setting the environment variable `PMCORE_TUI=false`.
pub fn read_settings(path: String) -> Result<Settings, config::ConfigError> {
let settings_path = path;

let parsed = eConfig::builder()
.add_source(config::File::with_name(&settings_path).format(config::FileFormat::Toml))
.add_source(config::Environment::with_prefix("NPCORE").separator("_"))
.add_source(config::Environment::with_prefix("PMCORE").separator("_"))
.build()?;

// Deserialize settings to the Settings struct
Expand Down
4 changes: 2 additions & 2 deletions src/tui/ui.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Defines the Terminal User Interface (TUI) for NPcore
//! Defines the Terminal User Interface (TUI) for PMcore
use crossterm::execute;
use eyre::Result;
Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn start_ui(mut rx: UnboundedReceiver<Comm>, settings: Settings) -> Result<(
terminal.show_cursor()?;
crossterm::terminal::disable_raw_mode()?;
tracing::info!("Exit signal received");
print!("NPcore was stopped by user");
print!("PMcore was stopped by user");
exit(0);
}
}
Expand Down

0 comments on commit dcee75f

Please sign in to comment.