Giter Site home page Giter Site logo

stoichkit's People

Contributors

tmkontra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zeta1999

stoichkit's Issues

error: Found argument ... which wasn't expected, or isn't valid in this context

Hi!

It seems that every time I try to calculate anything using any of the sub-commands, for example:
.../stoichkit/target/release$ ./stoichkit balance H2O+O2 = H2O2
or
.../stoichkit/target/release$ ./stoichkit theoretical-yield "2H2O2" 4.0 = "2H2O" O2

I always get the same error:
error: Found argument '=' which wasn't expected, or isn't valid in this context

(or other argument, like 'O2' or '0.5')

However, the toolkit has compiled properly and --V or --help options are working.

Am I missing something?

Crate has been compiled on Ubuntu 22.04.3 with rustc 1.74.0 (79e9716c9 2023-11-13)

feature(parse): support hyrdate syntax

Currently a hydrate molecule would need to be expressed as:

MgCl2(H2O)6

Traditionally, hydrates are denoted with an alternate syntax, since the water is part of the crystal:

MgCl2 * 6 H2O

refactor(model): layered domain model

Purpose: clean up usage of "Substance", "Reagent/Reactant", etc

  1. A substance is a parsed chemical formula (molecule, possibly a hydrate)
  2. A reactant is a substance with molar coefficient, a member of a reaction
  3. A reagent is a reactant with an amount (grams)

bug(solve): coefficients cannot be 0

For example

C2H4NO2 + H2O = CH3 + NO2 + H2O
returns
0 C2H4NO2 + 1 H2O = 0 CH3 + 0 NO2 + 1 H2O

A null matrix is always a solution, but is not a valid reaction. Some determination should be done to see if this is a bug/edge case in matrix decomposition or just a result of an impossible reaction.

If the reaction truly cannot be balanced, that error should be returned

refactor(parse): convert to state machine

Currently, the parser is adapted from solution 2 here. It uses a mutable iteration pointer and performs look-ahead based on the current character.

This is inflexible, and it would be nice to implement a strongly typed state machine that can handle spaces, hydrate syntax (#3,) etc

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.