<commit_before>#include <stack>
#include <memory>
#include <iostream>
#include <tinyxml2.h>
#include "scene.h"
#include "film/color.h"
#include "loaders/load_scene.h"
#include "volume/volume.h"
#include "volume/homogeneous_volume.h"
#include "volume/geometry_volume.h"
#include "volume/exponential_volume.h"
#include "volume/grid_volume.h"
#include "volume/volume_node.h"

Volume* load_volume(tinyxml2::XMLElement *elem, VolumeCache &cache, const std::string &scene_file){
	if (!elem->Attribute("name")){
		std::cout << "Scene error: Volumes require a name" << std::endl;
		return nullptr;
	}
	if (!elem->Attribute("type")){
		std::cout << "Scene error: Volumes require a type" << std::endl;
		return nullptr;
	}

	std::string name = elem->Attribute("name");
	std::string type = elem->Attribute("type");

	Volume *vol = cache.get(name);
	if (vol){
		return vol;
	}
	Colorf sig_a{1}, sig_s{1}, emit{1};
	float phase_asym;
	read_color(elem->FirstChildElement("absorption"), sig_a);
	read_color(elem->FirstChildElement("scattering"), sig_s);
	read_color(elem->FirstChildElement("emission"), emit);
	read_float(elem->FirstChildElement("phase_asymmetry"), phase_asym);

	if (type == "homogeneous"){
		Point min, max;
		read_point(elem->FirstChildElement("min"), min);
		read_point(elem->FirstChildElement("max"), max);<commit_msg>Use new color loading behavior to default volume attribts to 0<commit_after>#include <stack>
#include <memory>
#include <iostream>
#include <tinyxml2.h>
#include "scene.h"
#include "film/color.h"
#include "loaders/load_scene.h"
#include "volume/volume.h"
#include "volume/homogeneous_volume.h"
#include "volume/geometry_volume.h"
#include "volume/exponential_volume.h"
#include "volume/grid_volume.h"
#include "volume/volume_node.h"

Volume* load_volume(tinyxml2::XMLElement *elem, VolumeCache &cache, const std::string &scene_file){
	if (!elem->Attribute("name")){
		std::cout << "Scene error: Volumes require a name" << std::endl;
		return nullptr;
	}
	if (!elem->Attribute("type")){
		std::cout << "Scene error: Volumes require a type" << std::endl;
		return nullptr;
	}

	std::string name = elem->Attribute("name");
	std::string type = elem->Attribute("type");

	Volume *vol = cache.get(name);
	if (vol){
		return vol;
	}
	Colorf sig_a, sig_s, emit;
	float phase_asym;
	read_color(elem->FirstChildElement("absorption"), sig_a);
	read_color(elem->FirstChildElement("scattering"), sig_s);
	read_color(elem->FirstChildElement("emission"), emit);
	read_float(elem->FirstChildElement("phase_asymmetry"), phase_asym);

	if (type == "homogeneous"){
		Point min, max;
		read_point(elem->FirstChildElement("min"), min);
		read_point(elem->FirstChildElement("max"), max);
{'fraction_non_alphanumeric': 0.16951672862453532, 'fraction_numerical': 0.002973977695167286, 'mean_word_length': 6.666666666666667, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5601315', 'n_tokens_mistral': 950, 'n_tokens_neox': 916, 'n_words': 199}