Coder Social home page Coder Social logo

Comments (5)

cossatot avatar cossatot commented on July 18, 2024

If it's at all relevant, here is the function that Hamlet uses to generate a job.ini dict:

def make_job_ini(
    base_dir: str,
    lt_file: str = "ssmLT.xml",
    gmm_lt_file: str = "gmmLT.xml",
    description: Optional[str] = None,
):
    ssm_lt_path = os.path.join(base_dir, lt_file)
    gmm_lt_path = os.path.join(base_dir, gmm_lt_file)
    job_ini_params = {
        "general": {
            "calculation_mode": "preclassical",
            "description": description,
        },
        "calculation": {
            "rupture_mesh_spacing": 2.0,
            "area_source_discretization": 15.0,
            "width_of_mfd_bin": 0.1,  # typically smaller than from cfg; use cfg?
            "maximum_distance": 200,
            "investigation_time": 1.0,
            "source_model_logic_tree": ssm_lt_path,
            "gsim_logic_tree": gmm_lt_path,
        },
        "site_params": {
            "reference_vs30_type": "measured",
            "reference_vs30_value": 800.0,
            "reference_depth_to_1pt0km_per_sec": 30.0,
        },
    }

    job_ini_params_flat = {k: v for k, v in job_ini_params["general"].items()}
    job_ini_params_flat.update(job_ini_params["calculation"])
    job_ini_params_flat.update(job_ini_params["site_params"])

    job_ini_params_flat = {k: str(v) for k, v in job_ini_params_flat.items()}
    job_ini_params_flat["inputs"] = {
        "source_model_logic_tree": str(ssm_lt_path)
    }

    return job_ini_params_flat

from oq-engine.

micheles avatar micheles commented on July 18, 2024

Being able to pass a dictionary instead of a job.ini file is an essential feature that I want to support forever, not only for Hamlet-sake. I am very surprised that it is broken now. Can you point me to the Hamlet CI? Unfortunately I do not get notifications when it breaks, that is the issue.

from oq-engine.

micheles avatar micheles commented on July 18, 2024

BTW, your function make_job_ini looks wrong, you are missing the job_ini key which is mandatory. Just write

    job_ini_params_flat["inputs"] = {
        "job_ini": "<in-memory>",
        "source_model_logic_tree": ssm_lt_path}

from oq-engine.

cossatot avatar cossatot commented on July 18, 2024

Thanks Michele, that resolved the issue.

The Hamlet CI is found here: https://github.com/GEMScienceTools/hamlet/blob/master/.github/workflows/test_page.yaml

It doesn't seem to be triggered anymore--I'm not sure why, the file hasn't changed in a couple years and I didn't notice since I test locally before pushing typically and don't get email updates for successful test runs. Perhaps @vot4anto knows, since he made that file apparently?

from oq-engine.

micheles avatar micheles commented on July 18, 2024

It is a "feature" of the actions on GitHub. If nothing changes, after a period (3 months, I believe) the runner is automatically disabled and we cannot stop that from happening except by remembering to change something in the repository every 3 months :-(

from oq-engine.

Related Issues (20)

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.