CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::DB::Remove< ConfigType > Class Template Reference

#include <Remove.hh>

+ Inheritance diagram for CASM::DB::Remove< ConfigType >:

Detailed Description

template<typename ConfigType>
class CASM::DB::Remove< ConfigType >

Definition at line 55 of file Remove.hh.

Public Types

typedef ConfigType ConfigType
 

Public Member Functions

 Remove (const PrimClex &primclex, std::string report_dir)
 
void erase (const DB::Selection< ConfigType > &selection, bool dry_run)
 Erase Configurations that have no data. More...
 
void erase_data (const DB::Selection< ConfigType > &selection, bool dry_run)
 Erase data and files (permanently), but not Configuration. More...
 
void erase_all (const DB::Selection< ConfigType > &selection, bool dry_run)
 Removes Configurations and data and files (permanently) More...
 

Static Public Member Functions

static std::string desc ()
 
static int run (const PrimClex &, const Completer::RmOption &opt)
 

Protected Member Functions

const PrimClexprimclex () const
 
Database< Supercell > & db_supercell () const
 Path to default calctype training_data directory for config. More...
 
template<typename ConfigType >
Database< ConfigType > & db_config () const
 
PropertiesDatabasedb_props () const
 Uses primclex().settings().default_clex().calctype. More...
 
std::string calc_dir (const std::string configname) const
 Path to default calctype training_data directory for config. More...
 
bool has_existing_files (const std::string &to_configname) const
 Return true if there are existing files in the traning_data directory for a particular configuration. More...
 
bool has_existing_data (const std::string &to_configname) const
 Return true if there are existing files in the traning_data directory for a particular configuration. More...
 
bool has_existing_data_or_files (const std::string &to_configname) const
 
bool no_change (const std::string &configname) const
 Check if 'properties.calc.json' file has not changed since last read. More...
 
void rm_files (const std::string &configname, bool dry_run) const
 Remove existing files in the traning_data directory for a particular configuration. More...
 
void cp_files (ConfigIO::Result &res, bool dry_run, bool copy_additional_files) const
 Copy files in the same directory as properties.calc.json into the traning_data directory for a particular configuration. More...
 

Static Protected Member Functions

static std::string resolve_struc_path (std::string pos_path, PrimClex const &_pclex)
 Checks if pos_path can be used to resolve a properties.calc.json, and return its path Return path to properties.calc.json or POSCAR-type file that will be imported checking a couple possible locations relative to pos_path. More...
 

Private Member Functions

void _erase_report (const std::vector< std::string > &fail)
 

Private Attributes

std::string m_report_dir
 
const PrimClexm_primclex
 
std::function< PropertiesDatabase &()> m_db_props_func
 

Member Typedef Documentation

◆ ConfigType

Definition at line 29 of file Remove.hh.

Constructor & Destructor Documentation

◆ Remove()

template<typename ConfigType >
CASM::DB::Remove< ConfigType >::Remove ( const PrimClex primclex,
std::string  report_dir 
)

Definition at line 100 of file Remove_impl.hh.

Member Function Documentation

◆ _erase_report()

void CASM::DB::RemoveT< ConfigType >::_erase_report ( const std::vector< std::string > &  fail)
privateinherited

Definition at line 47 of file Remove_impl.hh.

◆ calc_dir()

std::string CASM::DB::ConfigData::calc_dir ( const std::string  configname) const
inherited

Path to default calctype training_data directory for config.

Definition at line 237 of file ConfigData.cc.

◆ cp_files()

void CASM::DB::ConfigData::cp_files ( ConfigIO::Result res,
bool  dry_run,
bool  copy_additional_files 
) const
inherited

Copy files in the same directory as properties.calc.json into the traning_data directory for a particular configuration.

  • First: calc_props_path = _calc_properties_path(pos_path) to get properties.calc.json location
  • If calc_props_path.empty(), return
  • else if !copy_additional_files copy properties.calc.json file only and return
  • else, recursively copy all files from calc_props_path.remove_filename() to the training data directory for the current calctype
Returns
{did_cp, did_cp_more}:
  • did_cp: if properties.calc.json file was found and copied
  • did_cp_more: if additional files were found and copied

Definition at line 307 of file ConfigData.cc.

◆ db_config()

template<typename ConfigType >
Database< ConfigType > & CASM::DB::ConfigData::db_config
inherited

Definition at line 22 of file ConfigData_impl.hh.

◆ db_props()

PropertiesDatabase & CASM::DB::ConfigData::db_props ( ) const
inherited

Uses primclex().settings().default_clex().calctype.

Definition at line 234 of file ConfigData.cc.

◆ db_supercell()

Database< Supercell > & CASM::DB::ConfigData::db_supercell ( ) const
inherited

Path to default calctype training_data directory for config.

Definition at line 230 of file ConfigData.cc.

◆ desc()

template<typename ConfigType >
std::string CASM::DB::Remove< ConfigType >::desc
static

Definition at line 104 of file Remove_impl.hh.

◆ erase()

void CASM::DB::RemoveT< ConfigType >::erase ( const DB::Selection< ConfigType > &  selection,
bool  dry_run 
)
inherited

Erase Configurations that have no data.

Definition at line 34 of file Remove_impl.hh.

◆ erase_all()

void CASM::DB::RemoveT< ConfigType >::erase_all ( const DB::Selection< ConfigType > &  selection,
bool  dry_run 
)
inherited

Removes Configurations and data and files (permanently)

  • Data are always associated with one 'from' configuration, so the selection here indicates 'from' configurations
  • The 'to' configurations are updated with the new best mapping properties
  • Data are always associated with one 'to' configuration, so the selection here indicates 'to' configurations
  • The 'from' configurations are updated with the new best mapping properties

Definition at line 44 of file Remove_impl.hh.

◆ erase_data()

void CASM::DB::RemoveT< ConfigType >::erase_data ( const DB::Selection< ConfigType > &  selection,
bool  dry_run 
)
inherited

Erase data and files (permanently), but not Configuration.

Definition at line 37 of file Remove_impl.hh.

◆ has_existing_data()

bool CASM::DB::ConfigData::has_existing_data ( const std::string &  to_configname) const
inherited

Return true if there are existing files in the traning_data directory for a particular configuration.

Return true if there is data already associated with a particular configuration.

Definition at line 257 of file ConfigData.cc.

◆ has_existing_data_or_files()

bool CASM::DB::ConfigData::has_existing_data_or_files ( const std::string &  to_configname) const
inherited

Definition at line 261 of file ConfigData.cc.

◆ has_existing_files()

bool CASM::DB::ConfigData::has_existing_files ( const std::string &  to_configname) const
inherited

Return true if there are existing files in the traning_data directory for a particular configuration.

Definition at line 247 of file ConfigData.cc.

◆ no_change()

bool CASM::DB::ConfigData::no_change ( const std::string &  configname) const
inherited

Check if 'properties.calc.json' file has not changed since last read.

Check if 'properties.calc.json' file has not changed since last read

  • Compares 'data_timestamp' && fs::last_write_time

Definition at line 269 of file ConfigData.cc.

◆ primclex()

const PrimClex& CASM::DB::ConfigData::primclex ( ) const
inlineinherited

Definition at line 152 of file ConfigData.hh.

◆ resolve_struc_path()

std::string CASM::DB::ConfigData::resolve_struc_path ( std::string  pos_path,
PrimClex const &  _pclex 
)
staticinherited

Checks if pos_path can be used to resolve a properties.calc.json, and return its path Return path to properties.calc.json or POSCAR-type file that will be imported checking a couple possible locations relative to pos_path.

checks: 1) is a JSON file? is pos_path ends in ".json" or ".JSON", return pos_path 2) assume pos_path is /path/to/POS, checks for /path/to/calctype.current/properties.calc.json 3) assume pos_path is /path/to/POS, checks for /path/to/properties.calc.json else returns pos_path

Definition at line 222 of file ConfigData.cc.

◆ rm_files()

void CASM::DB::ConfigData::rm_files ( const std::string &  configname,
bool  dry_run 
) const
inherited

Remove existing files in the traning_data directory for a particular configuration.

Definition at line 282 of file ConfigData.cc.

◆ run()

template<typename ConfigType >
int CASM::DB::Remove< ConfigType >::run ( const PrimClex primclex,
const Completer::RmOption opt 
)
static

Definition at line 130 of file Remove_impl.hh.

Member Data Documentation

◆ m_db_props_func

std::function<PropertiesDatabase &()> CASM::DB::ConfigData::m_db_props_func
privateinherited

Definition at line 192 of file ConfigData.hh.

◆ m_primclex

const PrimClex& CASM::DB::ConfigData::m_primclex
privateinherited

Definition at line 191 of file ConfigData.hh.

◆ m_report_dir

std::string CASM::DB::RemoveT< ConfigType >::m_report_dir
privateinherited

Definition at line 49 of file Remove.hh.


The documentation for this class was generated from the following files: