import intervals as I import project_functions from config import * import db_functions import pandas as pd file_name = '/home/olivier/gdrive/src/python/pyobserver/boris_projects/testing/test2_v7.boris' project_path, project_changed, pj, msg = project_functions.open_project_json( file_name) # print(pj[OBSERVATIONS].keys()) selected_observations = [ '0588', '1000', '0160', '0259', '0447', '0860', '1342' ] selected_observations = list(pj[OBSERVATIONS].keys()) selected_subjects = [pj[SUBJECTS][x]["name"] for x in pj[SUBJECTS]] print(selected_subjects) selected_behaviors = [pj[ETHOGRAM][x]["code"] for x in pj[ETHOGRAM]] print(selected_behaviors) def sql(): cursor = db_functions.load_aggregated_events_in_db(pj, selected_subjects, selected_observations, selected_behaviors)
if args.command[0].upper() == "LIST": for command in commands_list: print(command) print("=" * len(command)) if command in commands_usage: print(commands_usage[command]) print() print() sys.exit() if args.project_file: if not args.command: print("Project path: {}".format(args.project_file)) project_path, project_changed, pj, msg = project_functions.open_project_json( args.project_file) if "error" in pj: print(pj["error"]) sys.exit() if msg: print(msg) if args.observation_id: observations_id_list = args.observation_id ''' if not args.command: print("\nObservations:") for observation_id in observations_id_list: if observation_id in pj[OBSERVATIONS]: print("Id: {}".format(observation_id)) else:
fig.autofmt_xdate() plt.tight_layout() if output_file_name: plt.savefig(output_file_name) else: plt.show() return {"error code": 0, "msg": ""} if __name__ == '__main__': import project_functions _, _, pj, _ = project_functions.open_project_json( "/home/olivier/gdrive/src/python/pyobserver/boris_projects/boris_projects_from_users/lontre/progetto_lontre_zoom_2017-02-27_modified.boris" ) create_events_plot2_new(pj, ["0015", "0016"], ["Nina", "Himal", "Nautilus", "Sharky"], ["Alert", "Locomotion", "Sniff", "Rest", "Rub"], True, TIME_FULL_OBS, 0, 0, plot_directory="/tmp", file_format="pdf") ''' 63.167), (64.059, 67.251), (91.92, 94.602)], 'Rest': [], 'Rub |On the ground': [], 'Rub |On the trunks': [(67.334, 68.449)], 'Sniff': [(7.27, 8.514)], 'Sniff|An object': [], 'Sniff|The ground': [(67.333, 68.449)]}