8. Gsi aplication¶
8.1. Gsi.models¶
-
class
gsi.models.
Area
(*args, **kwargs)[source]¶ Model for the Areas.
Fields: name: Name of a Area
tiles: Relation with the Tile model from the applications GSI
-
class
gsi.models.
CardSequence
(*args, **kwargs)[source]¶ Model for the Card Sequences.
Functions: The CardSequence model unites the selected cards in a sequence of cards
Fields: name: Name the Card Sequence
environment_base: Relation with the VariablesGroup model from the applications GSI
environment_override: The Environment override for the object of the Card Sequence model
cards: Relation with the CardItem model from the applications cards
configfile: Relation with the ConfigFile model from the applications GSI
-
class
gsi.models.
ConfigFile
(*args, **kwargs)[source]¶ Model for the Config Files.
Fields: pathname: Path to the config file
description: The config file description
configuration_file: Name the configuration file
-
class
gsi.models.
HomeVariables
(*args, **kwargs)[source]¶ Model for the Home Variables.
Fields: SAT_TIF_DIR_ROOT: Satelite Data Top Level
RF_DIR_ROOT: Top directory of Random Forest Files
USER_DATA_DIR_ROOT: Top Level for user data directory
MODIS_DIR_ROOT: Top Level for raw Modis data
RF_AUXDATA_DIR: Top Level for Auxilliary data(SOIL, DEM etc.
SAT_DIF_DIR_ROOT: Top Level for Satelite TF files
-
class
gsi.models.
InputDataDirectory
(*args, **kwargs)[source]¶ Model for the Input Data Directorys.
Fields: name: Name of a Input Data Directory
full_path: Full path to the Input Data Directory
-
class
gsi.models.
ListTestFiles
(*args, **kwargs)[source]¶ Model for the Lists Test Files.
Fields: name: Name of a List Test Files
input_data_directory: Relation with the InputDataDirectory model from the applications GSI
size: File size
date_modified: Date modified of file
-
class
gsi.models.
Log
(*args, **kwargs)[source]¶ Model for the Logs.
Fields: name: Name the Log
log_file_path: The path to the log file
log_file: The log file name
-
class
gsi.models.
OrderedCardItem
(*args, **kwargs)[source]¶ Model for the Ordered Card Items.
Functions: The OrderedCardItem is an intermediary model for designed relational communication the objects of cards models with objects CardSequence model
Fields: card_item: Relation with the CardItem model from the applications Cards
sequence: Relation with the CardSequence model from the applications GSI
order: Priority object in its CardSequence
run_parallel: Startup type parallel or not
number_sub_cards: The number of sub-cards to the card when run
-
class
gsi.models.
Resolution
(*args, **kwargs)[source]¶ Model for the Resolutions.
Fields: name: Name of a Resolution (this will be a short display of the value, i.e. 1KM, 250M)
value: Value in meters, e.g 1000 for 1KM display name
-
class
gsi.models.
Run
(*args, **kwargs)[source]¶ Model for the Runs.
Functions: The Run model stores information about each startup RunBase model
Fields: user: Relation with the User model from the Django Auth model
run_base: Relation with the RunBase model from the applications GSI
state: Execution the RunBase model status
log: Relation with the Log model from the applications GSI
run_date: Execution the RunBase model date of creating
-
class
gsi.models.
RunBase
(*args, **kwargs)[source]¶ Model for the Runs Base.
Functions: The CardSequence model is designed to run the cards that are in the CardSequence model
Fields: name: Name the Run Bas
author: Relation with the User model from the Django Auth model
description: RunBase description
purpose: Purpose of Run
directory_path: Directory path
resolution: Resolution
card_sequence: Relation with the CardSequence model from the applications GSI
date_created: The RunBase object date created
date_modified: The RunBase object date modified
-
class
gsi.models.
RunStep
(*args, **kwargs)[source]¶ Model for the Runs Steps.
Functions: RunStep model stores information about the cards after execute RunBase model
Fields: parent_run: Relation with the Run model from the applications GSI
card_item: Relation with the OrderedCardItem model from the applications GSI
state: Status executed of the card work
start_date: Date of the run of card
-
class
gsi.models.
Satellite
(*args, **kwargs)[source]¶ Model for the Satellites.
Fields: name: Name of a Satellite
-
class
gsi.models.
SubCardItem
(*args, **kwargs)[source]¶ Model for the Sub-Card Items.
Functions: The SubCardItem model unites the syb-cards with its main the card to the parallel start.
Fields: name: Name the Sub-Card Item
state: Status executed of the card work
run_id: RUN ID’s
card_id: CARD ID’s
start_date: Date of the run of syb-card
start_time: Time of the run of syb-card
-
class
gsi.models.
TileType
(*args, **kwargs)[source]¶ Model for the Tile Types.
Fields: name: Name of a Tile Type
8.2. Gsi.views¶
-
gsi.views.
area_add
(request, *args, **kwargs)[source]¶ View for the “Area Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
area_edit
(request, *args, **kwargs)[source]¶ View for the “Area “<name>” Edit” page.
Arguments: - request: The request is sent to the server when processing the page
- area_id: The Area object ID
-
gsi.views.
areas
(request, *args, **kwargs)[source]¶ View for the “Areas” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
audit_history
(request, *args, **kwargs)[source]¶ View for the “Audit record for ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunBase object
-
gsi.views.
card_sequence_update
(request, *args, **kwargs)[source]¶ View the CardSequence object for editing in the creation of the Run.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunBase object ID
cs_id: The CardSequence object ID
-
gsi.views.
cards_list
(request, *args, **kwargs)[source]¶ View for the “Cards List” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
copy_runbase
(request, name)[source]¶ Copy the RunBase object.
Functions: The method creates a copy of an existing of the RunBase object.
Arguments: - name: The RunBase object name
- request: The request is sent to the server when processing the page
-
gsi.views.
customer_section
(request, *args, **kwargs)[source]¶ View for the “Customer ‘<user>’ section” page.
Functions: When you load the page is loaded map with Google MAP. Initial coordinates: eLat = 0, eLng = 0. Zoom map is variable GOOGLE_MAP_ZOOM, whose value is in the project settings. Code view allows to change position when you enter values in the fields on the page “Enter Lat” and “Enter Log”.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
environment_group_add
(request, *args, **kwargs)[source]¶ View for the “Environment Group Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
environment_group_edit
(request, *args, **kwargs)[source]¶ View for the “Environment Group “<name>” Edit” page.
Arguments: - request: The request is sent to the server when processing the page
- env_id: The VariablesGroup object ID
-
gsi.views.
environment_groups
(request, *args, **kwargs)[source]¶ View for the “Environment Groups” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
get_number_cards
(rb, user)[source]¶ Get the number of cards in the object RunBase.
Functions: The method creates a copy of an existing of the CardSequence object.
Arguments: - rb: The RunBase object
- user: Current the user
-
gsi.views.
handle_uploaded_file
(f, path)[source]¶ Upload file on the server.
Arguments: - f: File name
- path: Path where to save the file
-
gsi.views.
home_variable_setup
(request, *args, **kwargs)[source]¶ View for the “Home Variables Setup” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
index
(request, *args, **kwargs)[source]¶ View for the Main page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
input_data_dir_add
(request, *args, **kwargs)[source]¶ View for the “Input Data Directory Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
input_data_dir_edit
(request, *args, **kwargs)[source]¶ View for the “Input Data Directory Edit “<name>”” page.
Arguments: - request: The request is sent to the server when processing the page
- dir_id: The InputDataDirectory object ID
-
gsi.views.
input_data_dir_list
(request, *args, **kwargs)[source]¶ View for the “Input Data Directory” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
new_run
(request, *args, **kwargs)[source]¶ View for the “New Run” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
resolution
(request, *args, **kwargs)[source]¶ View for the “Resolutions” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
resolution_add
(request, *args, **kwargs)[source]¶ View for the ‘Resolution Add’ page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
resolution_edit
(request, *args, **kwargs)[source]¶ View for the “Resolution Edit ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- resolution_id: The Resolution object ID
-
gsi.views.
run_details
(request, *args, **kwargs)[source]¶ View the details executed of run of the cards.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunStep object ID
-
gsi.views.
run_progress
(request, *args, **kwargs)[source]¶ View for the “View Run Progress” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
run_setup
(request, *args, **kwargs)[source]¶ View for the “Setup New Run” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
run_update
(request, *args, **kwargs)[source]¶ View for the “Upload Test Data” page.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunBase object ID
-
gsi.views.
satellite
(request, *args, **kwargs)[source]¶ View for the “Satellite” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
satellite_add
(request, *args, **kwargs)[source]¶ View for the “Satellites Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
satellite_edit
(request, *args, **kwargs)[source]¶ View for the “Satellite Edit ‘<name>’ page.
Arguments: - request: The request is sent to the server when processing the page
- satellite_id: The Satellite object ID
-
gsi.views.
sub_card_details
(request, *args, **kwargs)[source]¶ View the details executed of run of the cards.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunStep object ID
card_id: The CardItem object ID
-
gsi.views.
submit_run
(request, *args, **kwargs)[source]¶ View for the “Submit a Run” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
tile_add
(request, *args, **kwargs)[source]¶ View for the “Tile Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
tile_edit
(request, *args, **kwargs)[source]¶ View for the “Tile Edit ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- tile_id: The Tile object ID
-
gsi.views.
tiles
(request, *args, **kwargs)[source]¶ View for the “Tiles” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
update_qrf_rftrain_card
(cs, cs_cards)[source]¶ Update the QRF and RFtrain cards.
Functions: The method takes the CardSequence model object and list of cards of CardSequence object. If the card QRF, it is written to the path of configfile CardSequence object. If the card RFtrain, it is written the name of the configfile of the CardSequence object.
Arguments: - cs: The CardSequence object
- cs_cards: List of the cards from the CardSequence object
-
gsi.views.
upload_file
(request, *args, **kwargs)[source]¶ View for the “Upload Test Data” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
view_log_file
(request, *args, **kwargs)[source]¶ View details of the files *.err and *.out of the cards.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunStep object ID
card_id: The Card object ID
status: Status executed to work of the cards
-
gsi.views.
view_log_file_sub_card
(request, *args, **kwargs)[source]¶ View details of the files *.err and *.out of the sub-cards.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunStep object ID
card_id: The Card object ID
count: The number of sub-cards
status: Status executed to work of the cards
-
gsi.views.
view_results
(request, *args, **kwargs)[source]¶ View for the “View results ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunBase object ID
-
gsi.views.
view_results_folder
(request, *args, **kwargs)[source]¶ View for the “View results ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- run_id: The RunBase object ID
- prev_dir: The prev directory
- dir: The current directory
-
gsi.views.
write_card_to_cs
(card_sequence, query)[source]¶ Update the QRF and RFtrain cards.
Functions: Method writes an object CardSequence card objects.
Arguments: - card_sequence: The CardSequence object
- query: request POST
-
gsi.views.
year_add
(request, *args, **kwargs)[source]¶ View for the “Year Add” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
year_edit
(request, *args, **kwargs)[source]¶ View for the “Year Edit ‘<name>’” page.
Arguments: - request: The request is sent to the server when processing the page
- year_id: The Year object ID
-
gsi.views.
years
(request, *args, **kwargs)[source]¶ View for the “Years” page.
Arguments: - request: The request is sent to the server when processing the page
-
gsi.views.
years_group
(request, *args, **kwargs)[source]¶ View for the “Years Groups” page.
Arguments: - request: The request is sent to the server when processing the page
8.3. Gsi.views_card_runid_csid¶
-
gsi.views_card_runid_csid.
cs_runid_csid_calcstats_edit
(request, *args, **kwargs)[source]¶ View for to edit CalcStats card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- calcstats_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_collate_edit
(request, *args, **kwargs)[source]¶ View for to edit Collate card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- collate_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_mergecsv_edit
(request, *args, **kwargs)[source]¶ View for to edit MergeCSV card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- mcsv_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_preproc_edit
(request, *args, **kwargs)[source]¶ View for to edit PreProc card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- preproc_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_qrf_edit
(request, *args, **kwargs)[source]¶ View for to edit QRF card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- qrf_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_randomforest_edit
(request, *args, **kwargs)[source]¶ View for to edit RandomForest card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- rf_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_remap_edit
(request, *args, **kwargs)[source]¶ View for to edit Remap card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- remap_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_rfscore_edit
(request, *args, **kwargs)[source]¶ View for to edit RFScore card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- rfscore_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_rftrain_edit
(request, *args, **kwargs)[source]¶ View for to edit RFTrain card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- rftrain_id: ID of the object of the CardItem model
-
gsi.views_card_runid_csid.
cs_runid_csid_year_filter_edit
(request, *args, **kwargs)[source]¶ View for to edit YearFilter card of the CardSequence model.
Arguments: - request: The request is sent to the server when processing the page
- run_id: ID of the RunBase
- cs_id: ID of the CardSequence
- card_id: ID of the card of the CardSequence model
- yf_id: ID of the object of the CardItem model
8.4. Gsi.gsi_forms¶
This module contains methods for creating and editing gsi forms.
-
class
gsi.gsi_forms.
EnvironmentGroupsForm
(*args, **kwargs)[source]¶ Form for editing Environment Groups.
8.5. Gsi.gsi_update_create¶
This module contains methods to refresh the data in the gsi objects after you create and edit.
-
gsi.gsi_update_create.
area_update_create
(form, multiple=None, item_id=None, delete=False)[source]¶ Updated Area model.
Arguments: - form: Object of the form
- multiple: Transmited a list of objects
- item_id: ID of the object. Set when editing (the default=None when you create a card)
- delete: Boolean value determine the remove objects or not
-
gsi.gsi_update_create.
configfile_update_create
(pathname)[source]¶ Updated ConfigFile model.
Arguments: - pathname: Path name
-
gsi.gsi_update_create.
create_update_card_sequence
(form, configfile=None, cs_id=None)[source]¶ Updated CardSequence model.
Arguments: - form: Object of the form
- multiple: Transmited a list of objects
- item_id: ID of the object. Set when editing (the default=None when you create a card)
- delete: Boolean value determine the remove objects or not
-
gsi.gsi_update_create.
data_dir_update_create
(form, item_id=None)[source]¶ Updated InputDataDirectory model.
Arguments: - form: Object of the form
- item_id: ID of the object. Set when editing (the default=None when you create a card)
-
gsi.gsi_update_create.
resolution_update_create
(form, item_id=None)[source]¶ Updated Resolution model.
Arguments: - form: Object of the form
- item_id: ID of the object. Set when editing (the default=None when you create a card)
-
gsi.gsi_update_create.
satellite_update_create
(form, multiple=None, item_id=None, delete=False)[source]¶ Updated Satellite model.
Arguments: - form: Object of the form
- multiple: Transmited a list of objects
- item_id: ID of the object. Set when editing (the default=None when you create a card)
- delete: Boolean value determine the remove objects or not
-
gsi.gsi_update_create.
tile_update_create
(form, item_id=None)[source]¶ Updated Tile model.
Arguments: - form: Object of the form
- item_id: ID of the object. Set when editing (the default=None when you create a card)
-
gsi.gsi_update_create.
var_group_update_create
(form, item_id=None)[source]¶ Updated VariablesGroup model.
Arguments: - form: Object of the form
- item_id: ID of the object. Set when editing (the default=None when you create a card)
-
gsi.gsi_update_create.
year_update_create
(form, item_id=None)[source]¶ Updated Year model.
Arguments: - form: Object of the form
- item_id: ID of the object. Set when editing (the default=None when you create a card)
-
gsi.gsi_update_create.
yg_update_create
(form, multiple=None, item_id=None, delete=False)[source]¶ Updated YearGroup model.
Arguments: - form: Object of the form
- multiple: Transmited a list of objects
- item_id: ID of the object. Set when editing (the default=None when you create a card)
- delete: Boolean value determine the remove objects or not
8.6. Gsi.signals¶
This module contains the signals that handle some types of events that are generated by the system.
-
gsi.signals.
added_update_area_for_each_tile
(sender, instance, **kwargs)[source]¶ When created new Tile object then creating a new Area object and in the field “tile” of Area models added the new Tiles object.
-
gsi.signals.
create_cs
(sender, instance, created, **kwargs)[source]¶ When created the new RunBase object than creating new the CardSequence object.
-
gsi.signals.
log_it_run
(sender, instance, **kwargs)[source]¶ Writes the log information on the status of the object Run.
-
gsi.signals.
log_it_runbase
(sender, instance, created, **kwargs)[source]¶ Write to log information about the change in RunBase object.
8.7. Gsi.tests¶
This module contains the tests for the gsi app.
-
class
gsi.tests.test_signals.
GsiSignalsTests
(methodName='runTest')[source]¶ Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
class
gsi.tests.test_models.
ModelsTestCase
(methodName='runTest')[source]¶ Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
test_homevariable_model
()[source]¶ Testing start HomeVariables model.
Checking with the creation of the test object initialization. Since the model is SingletonModel, then check to create another object model.
-
test_input_data_directory_model
()[source]¶ Testing start of the InputDataDirectory model.
When created model object InputDataDirectory create automatically the m2m field “full_path”.
The variable for the “full_path” field geting from the variable SAT_TIF_DIR_ROOT of the object of the HomeVariables model and the variable “name” of the object of the InputDataDirectory model
-