<commit_before># avida-spatial-tools
Some useful Python scripts for working with spatial structure in Avida<commit_msg>Added some semblance of actual documentation<commit_after># avida-spatial-tools
Some useful Python scripts for working with spatial structure in Avida

#Workflow:

* Parse the data:
  * One environment file: parse_environment_file()
  * Multiple environment files: parse_environment_file_list()
  * One or more grid_task files: load_grid_data()
* Transform the data (optional):
  * Convert values to counts of tasks performed or resources available: make_count_grid()
  * Convert phenotype values to numbers representing deviations from then optimal phenotype: make_optimal_phenotype_grid()
  * Convert values to ranks indicating the complexity of a phenoytype or resource set relative to others in the environment: assign_ranks_by_cluster()
  * Convert values to lists representing the percentage of organisms in that cell doing each task: task_percentages()
* Aggregate the data (if you have multiple files):
  * agg_grid()
* Visualize the data:
  * Color grid
  * Color grid by hue mixing
  * Overlay circles representing phenotypes on colored grid representing environment
    * Represent phenotypes as circles with single color
    * Represent phenotypes as concentric circles representing tasks that individual can do
  * Make a movie showing overlaid phenotypes changing over time


{'fraction_non_alphanumeric': 0.044744318181818184, 'fraction_numerical': 0.0, 'mean_word_length': 5.290178571428571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6998075', 'n_tokens_mistral': 350, 'n_tokens_neox': 325, 'n_words': 166}