<commit_before>module Taxonomy
  class TopicTaxonomy
    def initialize(adapter: RedisCacheAdapter.new, tree_builder_class: Tree)
      @adapter = adapter
      @tree_builder_class = tree_builder_class
    end

    def ordered_taxons
      @ordered_taxons ||= ordered_branches.select(&:visible_to_departmental_editors)
    end

    def all_taxons
      @all_taxons ||= branches.flat_map(&:taxon_list)
    end

    def visible_taxons
      @visible_taxons = all_taxons.select(&:visible_to_departmental_editors)
    end

  private

    def branches
      @branches ||= @adapter.taxon_data.map do |taxon_hash|
        @tree_builder_class.new(taxon_hash).root_taxon
      end
    end

    def ordered_branches
      @ordered_branches ||= branches.sort_by(&:name)
    end
  end
end<commit_msg>Fix visible_taxons to return all taxons<commit_after>module Taxonomy
  class TopicTaxonomy
    def initialize(adapter: RedisCacheAdapter.new, tree_builder_class: Tree)
      @adapter = adapter
      @tree_builder_class = tree_builder_class
    end

    def ordered_taxons
      @ordered_taxons ||= ordered_branches.select(&:visible_to_departmental_editors)
    end

    def all_taxons
      @all_taxons ||= branches.flat_map(&:taxon_list)
    end

    def visible_taxons
      @visible_taxons = branches.select(
        &:visible_to_departmental_editors
      ).flat_map(&:taxon_list)
    end

  private

    def branches
      @branches ||= @adapter.taxon_data.map do |taxon_hash|
        @tree_builder_class.new(taxon_hash).root_taxon
      end
    end

    def ordered_branches
      @ordered_branches ||= branches.sort_by(&:name)
    end
  end
end
{'fraction_non_alphanumeric': 0.0774862721171446, 'fraction_numerical': 0.0, 'mean_word_length': 3.350132625994695, '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': '4097625', 'n_tokens_mistral': 554, 'n_tokens_neox': 537, 'n_words': 98}