ngraymon/termfactory

Create workflow to replicate purpose of temp_file_renaming

Opened this issue · 4 comments

Create workflow to replicate purpose of temp_file_renaming

Per #62 (comment) the important part of temp_file_naming was the naming of the output file (lines 1736-1745 `generate_eT_zhz_python)

    # DEBUG - temporary override
    maximum_h_rank, maximum_cc_rank, maximum_T_rank, eT_taylor_max_order, omega_max_order = truncations
    path = "./eT_zhz_eqs"
    path += f"_H({maximum_h_rank})"
    path += f"_P({omega_max_order})"
    path += f"_T({maximum_T_rank})"
    path += f"_exp({eT_taylor_max_order})"
    path += f"_Z({maximum_cc_rank})"
    path += ".py"

and the looping over the different numbers in _glue_.py

for p, e, z in it.product(
    [2, 4],
    [1, 2, 3, 4],
    [1, 2, 3],
):

    # for the 'eT_z_t ansatz' only
    maximum_h_rank = 2
    maximum_cc_rank = z  # max order of Z
    maximum_T_rank = 1  # max order of T
    eT_taylor_max_order = e  # Taylor expansion of eT
    omega_max_order = p  # max order of projection operator

    # need to have truncation of e^T
    eT_z_t_truncations = maximum_h_rank, maximum_cc_rank, maximum_T_rank, eT_taylor_max_order, omega_max_order

    switch = 4

    if switch == 1:
        generate_latex_files(
            eT_z_t_truncations,
            only_ground_state=True,
            remove_f_terms=False,
            thermal=False,
            file='eT_z_t ansatz'
        )
    if switch == 2:
        generate_latex_files(
            truncations,
            only_ground_state=False,
            remove_f_terms=False,
            thermal=False,
            file='z_t ansatz'
        )
    if switch == 3:
        generate_latex_files(
            truncations,
            only_ground_state=True,
            remove_f_terms=False,
            thermal=False,
            file='full cc'
        )

    if switch == 4:
        generate_eT_zhz_python(eT_z_t_truncations, only_ground_state=True)
        # generate_full_cc_python(truncations, only_ground_state=True)

    print("We reached the end of main")

Really the purpose of this branch could simply be replicated by having a workflow which generates these files and zips them up as a release? artifact? somewhere for download? maybe in the repo in non-package folder (so not stored on pypi but accessible on the github page?)
But that might be a lot of code change, unnecessarily ...? So probably just a zip file?

Just pushed branch storage_generated_einsum_code which includes the files zipped up from temp_file_naming we can delete that branch now @lhprice