Git Product home page Git Product logo

Comments (7)

exaexa avatar exaexa commented on May 29, 2024

The thing I'd do is to have the types that depend on each other in a single file (together with the accessors), and put the rest of the stuff (prettyprinting etc.) to another directory so that the file isn't huge.

I've got this on the list of things to make nicer; aReaction seems just wrong. 😁

from cobrexa.jl.

laurentheirendt avatar laurentheirendt commented on May 29, 2024

I don't mind ... the idea was to keep maintenance low (not have to maintain the list of file names), but if it introduces other inconveniences, I am fine with changing.

The only question I have is why does the order matter so much when including the files?

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

@exaexa's solution would solve my issue, but I still prefer the super obvious: file-name == everything-to-do-with-that-struct "convention" I have currently. Otherwise a person new to the repo might have to go hunting for where a function is defined (I think?). However, this can quickly become murky because some functions use more than one struct, so it is debatable where they should go... At the moment each CobraTools originating file in the folder "types" only contains the really basic functions one would need for that type.

@laurentheirendt so in my case the order matters because I use Reaction in CobraModel but the file containing the definition of Reaction is alphabetically after the file containing the definition for CobraModel. This causes Julia to error when loading the package. I'm not sure if the way I am doing it is wrong though (from a style pov)?

from cobrexa.jl.

exaexa avatar exaexa commented on May 29, 2024

the main technical problem is that "you need to have all types in when you start to use them", which is partially solved by including types/ first, but doesn't really help with types that depend on other types. perhaps separate abstract_types/ type_parts/ and model_types/ ?

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

No longer a huge issue due to changing CobraModel to StandardModel in #53.

from cobrexa.jl.

laurentheirendt avatar laurentheirendt commented on May 29, 2024

so will we keep the automatic file loading mechanism?

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

Yes, I think so, maybe being creative isn't such a bad thing :)

from cobrexa.jl.

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.