10. Core package

Package with auxiliary functions.

10.1. Core.copy_card

The module for copying cards for copying run.

core.copy_card.calcstats_copy(card)[source]

The method copies the CalcStats card.

Arguments:
  • name: The card name
core.copy_card.collate_copy(card)[source]

The method copies the Collate card.

Arguments:
  • name: The card name
core.copy_card.create_copycard(card, card_type)[source]

The method determines the type of cards which function to copy the run.

Arguments:
  • card: The card name
  • card_type: The card type
core.copy_card.get_copy_name_card(name, model)[source]

The method creates a new name for the copied card.

Arguments:
  • name: The card name
  • model: The Card model object
core.copy_card.mergecsv_copy(card)[source]

The method copies the MergeCSV card.

Arguments:
  • name: The card name
core.copy_card.preproc_copy(card)[source]

The method copies the PreProc card.

Arguments:
  • name: The card name
core.copy_card.qrf_copy(card)[source]

The method copies the QRF card.

Arguments:
  • name: The card name
core.copy_card.randomforest_copy(card)[source]

The method copies the RandomForest card.

Arguments:
  • name: The card name
core.copy_card.remap_copy(card)[source]

The method copies the Remap card.

Arguments:
  • name: The card name
core.copy_card.rfscore_copy(card)[source]

The method copies the RFScore card.

Arguments:
  • name: The card name
core.copy_card.rftrain_copy(card)[source]

The method copies the RFTrain card.

Arguments:
  • name: The card name
core.copy_card.yearfilter_copy(card)[source]

The method copies the YearFilter card.

Arguments:
  • name: The card name

10.2. Core.get_post

The module for processing POST request.

core.get_post.add_card_in_cardsequence(card, cs_id)[source]

The method added the new Card object and its order in the CardSequence object.

Arguments:
  • card: The Card object
  • cs_id: The CardSequence object ID
core.get_post.cs_cards_update(form, cs_card, card_item)[source]

The method updates the value of the cards in CardSequence object.

Arguments:
  • form: The form object
  • cs_card: The OrderedCardItem object
  • card_item: The Card object
core.get_post.get_post(request, item_form, item, reverse_ulr, func, args=False, item_id=None, cs_form=False, cs_id=None)[source]

The method processes the POST request and sends a response from the server.

Arguments:
  • request: The request to the server
  • item_form: The Card form
  • item: The Card object
  • reverse_ulr: The URL redirection
  • func: The function to create or update Card
  • args: Additional options: Run ID, CardSequence ID, Card ID
  • item_id: The Card object ID (if the object is created the value default “None”)
  • cs_form: If an object is created or updated in CardSequence object, the value is “True”. Default is “False”
  • cs_id: If an object is created or updated in CardSequence object, the value is CardSequence object ID. Default is “None”

10.3. Core.multithreaded

The module for multi-threaded processing cards.

class core.multithreaded.MultiprocessingCards(queue, flag='cards')[source]

Class receives a card that you want to run. It creates a queue and starts a multithreaded cards.

multiprocessing_cards(param)[source]

The method receives the parameters and starts the implementation process for each type.

run()[source]

Method run multi-threaded process.

10.4. Core.paginations

The package for the implementation of pagination.

core.paginations.paginations(request, model_name)[source]

The method generates a page-pagination.

Arguments:
  • request: The request form the server
  • model_name: The Model object

10.5. Core.validator_gsi

The package for the validation fields of models.

core.validator_gsi.validate_order(value)[source]

The method makes the validation of numerical field on a positive number.

Arguments:
  • value: Input value

10.6. Core.utils

Package with additional functionality.

class core.utils.UnicodeNameMixin[source]

Class inheritance for other classes of models.

Functions:When inheriting displays the model name
core.utils.convert_size_file(size)[source]

Method convert a numeric value of the file size in the text designations: B, KB, MB.

core.utils.copy_file(src, dest, card_name)[source]

The method copies the file specification.

core.utils.create_new_folder(dir)[source]

The method to create a new directory for the model Input Data Directory

core.utils.create_open_master_script(path_runs, card_id, num)[source]

The method creates a script file and set it permissions 777.

core.utils.create_scripts(run, sequence, card, step)[source]

The method for create a scripts at startup RunBase object for the each cards.

core.utils.create_sub_card_item(name, run_id, card_id)[source]

The method creates a new object model SubCardItem.

core.utils.create_sub_dir(path)[source]

Method to create directorys: Results, Scores, Trees.

The method creates a symlink to transmit directory.

Functions:

Check whether there is already such a symlink. If not, create.

Arguments:
  • src: Folder which do symlink
  • dest: The folder from which make a symlink
  • path: The path for check the existence of symbolic link
core.utils.execute_fe_command(params, flag='cards')[source]

The method returns the principal name.

Functions:

It is used when creating a copy card in the object CardSequence.

Arguments:
  • params: Current options for the execute
  • flag: Specifies to which the entity of the process is performed is started
core.utils.get_area_tiles(name)[source]

The method geting all tiles from an object Area.

core.utils.get_card_model(card_model, card_name)[source]

The method geting type model for the card.

core.utils.get_copy_name(name)[source]

The method returns the principal name.

Functions:

It is used when creating a copy card in the object CardSequence.

Arguments:
  • name: Card name
core.utils.get_dir_root_static_path()[source]

Method for get the symbolic link.

core.utils.get_executable(run, sequence, card, card_item)[source]

The method gets a value for the variable EXECUTABLE for the each card for the create_scripts method.

core.utils.get_files(path, file_extension)[source]

The method to get a list of files from a specified directory and file extension.

Returns a list of files and errors in the preparation of a list of files

Arguments:
  • path: The path to the file
  • file_extension: The file extension
core.utils.get_files_dirs(url_path, full_path)[source]

The method to get a list of all files and directories from a given path.

core.utils.get_path_folder_run(run)[source]

The method receives to the logs folder a run.

core.utils.get_statistical_method(remap_obj)[source]

The method geting statistical method.

core.utils.get_type_file(mime_type)[source]

The method determines the mime-type of file: image, text, pdf, msword, doc, archive.

core.utils.get_years(name)[source]

The method geting all year from an object YearGroup.

core.utils.is_run_parallel(card)[source]

The method checks the type of start-up cards: parallel or in series.

core.utils.make_run(run_base, user)[source]

The method starts work on card processing script.

core.utils.slash_remove_from_path(path)[source]

The method removes superfluous slashes in path.

Functions:

Checks whether there is in the transmission path of the extra slashes. If found, it replaces them with the standard one.

Arguments:
  • path: Path (string)
core.utils.update_list_dirs()[source]

The method updates the list of files and directory for the ListTestFiles and the InputDataDirectory models.

core.utils.update_list_files(obj_dir)[source]

The method updates the list of files from a specified directory to the model ListTestFiles.

core.utils.update_root_list_files()[source]

The method updates the list of files to ListTestFiles model.

core.utils.validate_status(status)[source]

The method makes the validation status for the API.

Functions:

Checks whether there is obtaining the status of the list of possible statuses.

Arguments:
  • status: Current status
core.utils.write_log(log_name, run, path_log)[source]

The method writes a Log model GSI app.