Giter Club home page Giter Club logo

termfactory's People

Contributors

lhprice avatar ngraymon avatar

Stargazers

 avatar  avatar

Forkers

michielcuijpers

termfactory's Issues

yaml problems

Trying to make gitlab-ci.yaml work on windows and/or inside unix
looked at the following links:

  1. https://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux
  2. https://stackoverflow.com/questions/54761464/how-to-use-if-else-condition-on-gitlabci
  3. https://docs.gitlab.com/ee/ci/yaml/#variables
  4. https://docs.gitlab.com/ee/ci/variables/index.html#custom-cicd-variables

eventually we gave up on trying to use all the solutions and just had lucas install WSL2 and run the gitlab runner inside docker on wsl2

The actual migration from gitlab to github

Make new test/code cov python file

instead of

py -m coverage run generate_residual_equations.py
we want to run

py -m coverage run code_cov.py

which basically is just a fancy wrapper around generate_residual_equations.py
which loops over all possible permutations (ground state versus not ground state...etc) of the execution of the main functions:

  • generate_latex_files
  • generate_python_files

Also, this would check what functions are not used at all right now.
In this way we don't need to change the module generate_residual_equations.py to fit testing/code cov details
rather all of that business can be relegated to code_cov.py

Is standard practice to have a branch off the main branch which has all the testing files etc?
Or what?

Make all truncations/max_order/number parameters key/value pairs in dictionary

image
image

Rather then having them be a list of numbers orindividual keywords (which makes the function definitions super crazy long and unreadable) lets just have all of these 'master/parent' functions take an argument truncation which should always be a dictionary. Also add in simple checks for each function to make sure the expected keys are present and that the numbers provided are in an acceptable range (0 < N < max_number is probably fine for all of them, define the maximums at the top of the file)

Also we probably want the dictionary keys to be expanded in full so as to not confuse them with the variables used in the functions.
Meaning

maximum_h_rank becomes maximum_hamiltonian_rank

maximum_cc_rank becomes maximum_coupled_cluster_rank

so like just below here

image

truncation_maximums = {
    maximum_h_rank: 6,
    maximum_cc_rank: 6,
    s_taylor_max_order: 6,
    omega_max_order: 6,
    max_residual_order: 8, 
    max_w_order: 8,
    dt_order: 8,
}

and then around line 3265 (cut out the red lines)
image

for key in ["maximum_h_rank", "maximum_cc_rank", "s_taylor_max_order", "omega_max_order"]:
   assert key in truncations, f"Missing key {key = :s} in provided dictionary {truncations=:}"
   assert truncations[key] <= truncation_maximums[key], f"Key {key = :s} is over the maximum of {truncation_maximums[key] = :}"
maximum_h_rank = truncations["maximum_h_rank"]
maximum_cc_rank = truncations["maximum_cc_rank "]
s_taylor_max_order = truncations["s_taylor_max_order "]
omega_max_order = truncations["omega_max_order "]

Improve the logging?

See this link for logging numbers
maybe we want to define our own custom logging numbers??
i know i probably log more than necessary but it is good to have the option for extreme output when debugging sometime. For example being able to do something like:

if loop_index == 43:
    log.setLevel(0)
else:
    log.setLevel('ERROR')

which only prints the logs from the 43rd loop
image

remake docker

In GitLab by @lhprice on Nov 3, 2021, 19:17

reminder for me to check if pytest is baked into the docker image

Improve I/O and user input (argparse)

We should add argparse to better take user input.

Should also designate an output folder to save the .tex files and .pdf files to.
This could be something modified by the user input through argparse.

Mostly this is because I realized the directory was getting crowded

Update

update latex_eT_zhz.py with LHS code ?

If we wanted to look at a few other molecules

We don't have to but I thought I'd throw the files up here in case you wanted to try and run them.
@bsonghao

Formaldehyde photoelectron spectrum

Formaldehyde

Chloroethylene photoelectron spectrum

Chloroethylene

Methane photoelectron spectrum

methane

Furan photoelectron spectrum

Furan

add requirements file

should only need numpy inside?
then the CI/CD yaml can just say to

pip install -r <file>
instead of each specific thing

this seems more proper

Figure out github specific syntax for repo add-ons

Things like

L71ULxk0Ed

probably have different syntax / implementations on github versus gitlab.

I imagine there are a variety of things like this.

Such as 'importing/exporting' the issues and how they setup boards etc. etc.

Things like ci integration / gitlab runner, [ci] versus [lightsail] etc.

First stab at formalism (benny)

  1. Practice writing out the terms for the $\Omega^0_0$ case (given the 4 numbers) and make sure the rules are clear
  2. start to compile some sources
  3. play around with representations

Add individual function return value tests

Adding testing to the following modules:

  • code_dt_equations.py
  • code_full_cc.py
  • code_residual_equations.py
  • code_w_equations.py
  • latex_eT_zhz.py
  • latex_full_cc.py
  • latex_w_equations.py
  • latex_zhz.py

  • correct docstrings
  • cleanup todo statements
  • move large strings/lists to separate files
  • add on tests that output files to check to a ref file and return if test has passed
  • add/remove classes
  • enhance tests with more cases

and these modules are not being covered/tested:

  • common_imports.py
  • latex_defines.py
  • reference_latex_headers.py
  • helper_functions.py

Using Maude to generate equations (how the hell does this work?!?!)

We definitely need the Format stuff (section 4.4.5 pg 59) to add colour and spacing to our things.
I wonder if we could even generate all the equations in Maude, wouldn't that be wild

I should record ideas I have here:

  • Metadata (pg 70, section 4.5.2) could be used like [metadata "h^1_0"] to have a string version of the equation/object?
  • second version of [owise] is just completely ignored so it really does work like an else statement
  • what the actual f**k does the first 0 element in the evaluation strategy (0 1 0) actually DO!>?!?!?.
    Addendum: it seems that it DOES evaluate at the top (but doesn't fail if there is no rule, instead the full strategy is completed before failing)
    So one can write something like (0 1 0 2 0) for f(a,b) which represents:
  1. evaluating at the top
  2. reducing argument a to canonical form t
  3. evaluating at the top f(t, b)
  4. reducing argument b to canonical form t2
  5. evaluating at the top f(t, t2)

Preparing the code as a package

writing a setup.cfg, all that other stuff
probably a good experience for @lhprice and he can look at Pibronic as an example

this is the stuff that makes pip install resid-build work!

For testing purposes you can do pip install -e resid-build

Fatorizing out X, X2 etc terms?

terms such as

dz_i -= 0.5 * X * np.einsum('k,l,ykli->yi', T_conj[1], T_conj[1], Z[3])
dz_i -= 0.5 * np.einsum('k,l,ykli->yi', T_conj[1], T_conj[1], dz_3)

where

X = np.einsum('k,k->', T_conj[1], dT[1])
X2 = np.einsum('k,j,kj->', T_conj[1], T_conj[1], dT[1])

although maybe X2 doesn't even make sense?
so maybe just abandon this whole thing

clean up blanket test to make them more readable

starting from

total_list=[[(1, 1, 1, 1, 1, [1], [1]),
(1, 0, 0, 0, 0, [0], [0]),
((1,1, 2, 1),)],
[(1, 0, 0, 0, 0, [0], [0]),
(1, 0, 1, 0, 0, [0], [1]),
((1, 0, 0, 0),)],
[(0, 0, 0, 0, 0, [0], [0]),
(1, 1, 0, 0, 0, [1], [0]),
((0, 1, 0, 0),)]]
fcc._seperate_s_terms_by_connection(total_list)

next step

total_list = [
    [
        (1, 1, 1, 1, 1, [1], [1]),
        (1, 0, 0, 0, 0, [0], [0]),
        ((1, 1, 2, 1),)
    ],
    [
        (1, 0, 0, 0, 0, [0], [0]),
        (1, 0, 1, 0, 0, [0], [1]),
        ((1, 0, 0, 0),)
    ],
    [
        (0, 0, 0, 0, 0, [0], [0]),
        (1, 1, 0, 0, 0, [1], [0]),
        ((0, 1, 0, 0),)
    ]
]
fcc._seperate_s_terms_by_connection(total_list)

further more

L1 = [
        (1, 1, 1, 1, 1, [1], [1]),
        (1, 0, 0, 0, 0, [0], [0]),
        ((1, 1, 2, 1),)
]
L2 = [
        (1, 0, 0, 0, 0, [0], [0]),
        (1, 0, 1, 0, 0, [0], [1]),
        ((1, 0, 0, 0),)
]
# O^1_0   h^0_0  t_0
L3 = [
        (0, 0, 0, 0, 0, [0], [0]),  # omega term
        (1, 1, 0, 0, 0, [1], [0]),  # h term
        ((0, 1, 0, 0),)             # list of t terms
]
total_list = [ L1, L2, L3 ]
fcc._seperate_s_terms_by_connection(total_list)

Setup gitlab runner on lightsail

Asked my friend what online services he uses and he recommended lightsail I'm willing to pony 5$ a month if you can figure out how to setup a runner on one of their virtual servers. It seems at the moment we'd get 3 months free too. Then we can link the deployment to the server and you don't have to run directly off your machine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.