示例#1
0
def _config_dumper(config_input):
    return GroupContainer(
        attrs={
            "start": config_input.start,
            "stop": config_input.stop,
            "taylor_stop_angle": config_input.taylor_stop_angle,
            "max_steps": config_input.max_steps,
            "num_angles": config_input.num_angles,
            "label": config_input.label,
            "relative_tolerance": config_input.relative_tolerance,
            "absolute_tolerance": config_input.absolute_tolerance,
            "γ": config_input.γ,
            "nwalkers": config_input.nwalkers,
            "iterations": config_input.iterations,
            "threads": config_input.threads,
            "target_velocity": config_input.target_velocity,
            "split_method": config_input.split_method,
            "v_rin_on_c_s": config_input.v_rin_on_c_s,
            "v_a_on_c_s": config_input.v_a_on_c_s,
            "c_s_on_v_k": config_input.c_s_on_v_k,
            "η_O": config_input.η_O,
            "η_H": config_input.η_H,
            "η_A": config_input.η_A,
            "η_derivs": config_input.η_derivs,
            "use_taylor_jump": config_input.use_taylor_jump,
            "use_E_r": config_input.use_E_r,
        },
        jump_before_sonic=config_input.jump_before_sonic,
        mcmc_vars=config_input.mcmc_vars,
        v_θ_sonic_crit=config_input.v_θ_sonic_crit,
        after_sonic=config_input.after_sonic,
        sonic_interp_size=config_input.sonic_interp_size,
        interp_range=config_input.interp_range,
        interp_slice=config_input.interp_slice,
    )
示例#2
0
def _jacobian_data_dumper(jacobian_data):
    # pylint: disable=protected-access
    jacobian_data._finalise()
    # pylint: enable=protected-access
    return GroupContainer(
        derivs=jacobian_data.derivs,
        params=jacobian_data.params,
        angles=jacobian_data.angles,
        jacobians=jacobian_data.jacobians,
    )
示例#3
0
def _run_dumper(run):
    return GroupContainer(
        time=run.time,
        config_filename=run.config_filename,
        config_input=run.config_input,
        float_type=run.float_type,
        final_solution=run.final_solution,
        solutions=run.solutions,
        skw_full_code_version=run.skw_full_code_version,
    )
示例#4
0
def _run_dumper(run):
    return GroupContainer(
        time=run.time,
        config_filename=run.config_filename,
        config_input=run.config_input,
        float_type=run.float_type,
        final_solution=run.final_solution,
        solutions=run.solutions,
        disc_solver_version=run.disc_solver_version,
        sonic_method=run.sonic_method,
        use_E_r=run.use_E_r,
    )
示例#5
0
def _initial_dump(initial_conditions):
    return GroupContainer(
        attrs={
            "a_0": initial_conditions.a_0,
            "σ_O_0": initial_conditions.σ_O_0,
            "σ_P_0": initial_conditions.σ_P_0,
            "σ_H_0": initial_conditions.σ_H_0,
            "ρ_s": initial_conditions.ρ_s,
            "init_con": initial_conditions.init_con,
        },
        heights=initial_conditions.heights,
    )
示例#6
0
def _solution_dumper(solution):
    return GroupContainer(
        attrs={
            "flag": solution.flag,
        },
        heights=solution.heights,
        solution=solution.solution,
        initial_conditions=solution.initial_conditions,
        t_roots=solution.t_roots,
        y_roots=solution.y_roots,
        solution_input=solution.solution_input,
    )
示例#7
0
 def _internal_dump(internal_data):
     return GroupContainer(
         derivs=internal_data.derivs,
         params=internal_data.params,
         angles=internal_data.angles,
         v_r_normal=internal_data.v_r_normal,
         v_phi_normal=internal_data.v_phi_normal,
         rho_normal=internal_data.rho_normal,
         v_r_taylor=internal_data.v_r_taylor,
         v_phi_taylor=internal_data.v_phi_taylor,
         rho_taylor=internal_data.rho_taylor,
     )
示例#8
0
 def _solution_dumper(solution):
     return GroupContainer(
         attrs={
             "flag": solution.flag,
             "coordinate_system": solution.coordinate_system,
         },
         angles=solution.angles,
         solution=solution.solution,
         internal_data=solution.internal_data,
         initial_conditions=solution.initial_conditions,
         t_roots=solution.t_roots,
         y_roots=solution.y_roots,
     )
示例#9
0
 def _initial_dump(initial_conditions):
     return GroupContainer(
         attrs={
             "norm_kepler_sq": initial_conditions.norm_kepler_sq,
             "c_s": initial_conditions.c_s,
             "eta_O": initial_conditions.eta_O,
             "eta_A": initial_conditions.eta_A,
             "eta_H": initial_conditions.eta_H,
             "beta": initial_conditions.beta,
             "init_con": initial_conditions.init_con,
         },
         angles=initial_conditions.angles,
     )
示例#10
0
def _initial_dump(initial_conditions):
    return GroupContainer(
        attrs={
            "norm_kepler_sq": initial_conditions.norm_kepler_sq,
            "a_0": initial_conditions.a_0,
            "η_O": initial_conditions.η_O,
            "η_A": initial_conditions.η_A,
            "η_H": initial_conditions.η_H,
            "γ": initial_conditions.γ,
            "init_con": initial_conditions.init_con,
        },
        angles=initial_conditions.angles,
    )
示例#11
0
def _input_dumper(solution_input):
    return GroupContainer(attrs={
        "start": solution_input.start,
        "stop": solution_input.stop,
        "max_steps": solution_input.max_steps,
        "num_heights": solution_input.num_heights,
        "relative_tolerance": solution_input.relative_tolerance,
        "absolute_tolerance": solution_input.absolute_tolerance,
        "v_rin_on_c_s": solution_input.v_rin_on_c_s,
        "v_a_on_c_s": solution_input.v_a_on_c_s,
        "σ_O_0": solution_input.σ_O_0,
        "σ_P_0": solution_input.σ_P_0,
        "σ_H_0": solution_input.σ_H_0,
        "ρ_s": solution_input.ρ_s,
    }, )
示例#12
0
def _internal_dump2(internal_data):
    # pylint: disable=protected-access
    internal_data._finalise()
    # pylint: enable=protected-access
    return GroupContainer(
        derivs=internal_data.derivs,
        params=internal_data.params,
        angles=internal_data.angles,
        jacobian_data=internal_data.jacobian_data,
        v_r_normal=internal_data.v_r_normal,
        v_φ_normal=internal_data.v_φ_normal,
        ρ_normal=internal_data.ρ_normal,
        v_r_taylor=internal_data.v_r_taylor,
        v_φ_taylor=internal_data.v_φ_taylor,
        ρ_taylor=internal_data.ρ_taylor,
        problems=internal_data.problems,
    )
示例#13
0
 def _exp_dump(experiment):
     return GroupContainer(dataset=DatasetContainer(data=experiment.data),
                           attrs={"time started": experiment.time_started})
示例#14
0
 def _run_dumper(run):
     return GroupContainer(
         solutions=run.solutions,
         final_solution=run.final_solution,
     )
示例#15
0
 def _exp_dump(experiments):
     return GroupContainer(runs=GroupContainer(**experiments.runs),
                           attrs={"name": experiments.name})
示例#16
0
def _problems_dumper(problems):
    group = GroupContainer()
    for key, item in problems.items():
        group[key] = asarray([s.encode("utf8") for s in item])
    return group
示例#17
0
def _dict_dumper(d):
    # pylint: disable=missing-docstring
    return GroupContainer(**d)
示例#18
0
def _mcmc_vars_dumper(mcmc_vars):
    return GroupContainer(
        with_v_r=mcmc_vars.with_v_r,
        with_v_a=mcmc_vars.with_v_a,
        with_v_k=mcmc_vars.with_v_k,
    )
示例#19
0
def _slice_dumper(slice_):
    return GroupContainer(
        start=slice_.start,
        stop=slice_.stop,
        step=slice_.step,
    )