Git Product home page Git Product logo

Comments (1)

patrickfuller avatar patrickfuller commented on July 18, 2024

Contents of an email sent to David Dubbeldam copied below.

David,

There’s a json-c library that’s MIT licensed, so that could be lifted easily enough

I’m a fan of JSON due to its ubiquitousness, but, if you’re concerned about hits to human readability, there are other formats that could be considered.

I’m going to write out a few and see what they look like. Here’s a sample json:

{
  "simulation type": "monte carlo",
  "number of cycles": 100000,
  "number of initialization cycles": 10000,
  "print every": 1000,

  "boxes": [
    {
      "box lengths": [30, 30, 30],
      "external temperature": 300,
    }
  ],

  "components": {
    "methane": {
      "translation probability": 1.0,
      "create number of molecules": 100
      }
    }
}

Here’s a sample pyconfig:

simulation_type = "monte carlo"
number_of_cycles = 100000
number_of_initialization_cycles = 100000
print_every = 1000

boxes = {"box lengths": [30, 30, 30], "external temperature": 300}
components = {"methane": {"translation probability": 1.0,  "create number of molecules": 100}}

Here’s a sample yaml:

simulation_type: MonteCarlo
number_of_cycles: 100000
number_of_initialization_cycles: 100000
print_every: 1000

boxes:
    - box_lengths: [30, 30, 30]
      external_temperature: 300

components:
    - methane
          - translation probability: 1.0
            create number of molecules: 100

They are all computer readable and come with elegant error handling. JSON does seem messy for a config. Python is easy to parse and allows people to write runnable code in their configs, which is neat. YAML looks the most like the current format, but would require third-party libraries for data handling. Thoughts?

Anyway, I’d be willing to edit up a RASPA fork with some of these ideas. I’d maintain the current API and have this option in addition. If people like it, we could switch to it in a v3 release.

Pat

from raspa2.

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.