Git Product home page Git Product logo

jacquescarette / drasil Goto Github PK

View Code? Open in Web Editor NEW
133.0 16.0 25.0 665.98 MB

Generate all the things (focusing on research software)

Home Page: https://jacquescarette.github.io/Drasil

License: BSD 2-Clause "Simplified" License

Makefile 0.96% Shell 0.62% Haskell 98.20% Python 0.15% CSS 0.03% Nix 0.04%
knowledge scientific haskell haskell-language dsl documentation-generator code-generation drasil-framework

drasil's People

Contributors

akm11 avatar ant13731 avatar awurama-n avatar balacij avatar bmaclach avatar cd155 avatar daijingz avatar danscime avatar dependabot[bot] avatar deviprasad135 avatar elwazana avatar gothicultra avatar harmanpreet-sagar avatar hrzhuang avatar jacquescarette avatar janim2-2004 avatar jeger1917 avatar lmawarid avatar mornix avatar muhammadaliog3 avatar nathaniel-hu avatar niazim3 avatar oluowoj avatar palmerst avatar peter-michalski avatar samm82 avatar smiths avatar sodaaaa avatar szymczdm avatar tingyuw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drasil's Issues

TeX math mode dollar signs

Drasil does not currently write dollar signs for symbols requiring math mode (such as those with subscripts, Greek letters, etc.)

Luthfi

Label/Symbol mix-up in Data Definitions

When Data Definitions are printed in TeX, the symbol is placed in a row called "Label" and the label only appears as part of the Refname row.

In HTML, the row called "Label" displays "DD: " followed by the symbol. The actual label does not appear at all (by label I mean the short name of the data, for example "Heat flux out of coil").

Internal references to definitions/models link to beginning of section

In the PDF file generated from the TeX file, clicking on internal references to theoretical models and data definitions takes you to the beginning of the corresponding section, rather than actually taking you to the model/definition. For example, clicking on a link to T:Lhe (The theoretical model for Latent Heat Energy) will take you to the beginning of the "Theoretical Models" section, rather than the beginning of the actual theoretical model in question.

Printing derivative symbols

Currently, using "Deriv" will print partial derivatives. There is no way to print a regular derivative, such as the one shown within the integral below:

integral

Notes in tables

Would it be possible to add notes to specific items in a table, for example with an asterisk, like in the picture below, without having to type the whole table out manually? Ideally I would want to make tables using mkTable and lambdas, but that's currently not possible if I want to add these notes.

tablewithasterisksexample

Excluding a section from the section numbering

In the TeX file for my manual SRS, \subsubsection* is used to initialize the derivation sections, so that they can be a separate section with a title, but do not count towards the section numbering. Is there a way for this to be implemented in Drasil?

I can't just make a new Section object for them currently, because they would need to be a subsubsubsection, which isn't possible.

Table captions shifted to the right in SRS

The captions for tables are not centered, but instead shifted to the right. Sometimes this still looks okay, as below:

drasiltablecaptionshift

But with longer captions, the caption gets cut off:

drasiltablecaptioncutoff

This problem only exists for the SRS Doctype, captions are centered in the HTML docs.

Multiplication sign

In glassbr_srs -> 6.2.3 Instance Models -> IM2, the relation between LR, GTF, NFL and LSF is like this:
LR = NFL * GTF * LSF.
Currently, the multiplication signs are omitted in the output file, but they are quite meaningful in this case. Otherwise, the equation will look like this: LR = NFLGTFLSF

Fractions within Paragraphs

This might not be an issue at all but I thought I'd mention it just in case. There are some instances in my manual SRS where there is a fraction as part of a paragraph, such as below:

fractionwithinparagraph

I am currently representing this in Drasil as shown below because I can't find a way to actually print it as a fraction. Representing it as I have is still correct, though, which is why I'm not sure if this is a problem.

fractionwithinparagraphnot

Unit products are reversed

When making derived units based on products of other fundamental/derived units, the HTML and TeX printers reverse the symbols.

Changing the lambda expression in the foldr1 to a simple (++) seems to solve the issue.

Luthfi

Compilation error due to ambiguity of :< and :>

I'm getting a compilation error due to ambiguity between the :< and :> defined in Expr.hs and the ones imported from Control.Lens in the latest committed version.

Screenshot of cmd for reference:
error

Units in Data Definition descriptions

Since the description sections of the Data Definitions are mostly automated, there is currently no way to show the units for each symbol in parentheses following the description for each symbol.

Unitless

Some of the symbols are unitless. Might need defn for "unitless".

Unify Data Definitions automation for Theoretical models and Instance Models?

Can we unify how data definitions, theoretical models and instance models are handled in Drasil. Currently the description field of the data definition is automated for data definitions, but not for theoretical models and instanced models. In many cases the content of the description for instance models and theoretical models is just a summary of the variables in the equation or relation.

Continuous Integration

We should add methods for regression testing of Drasil. The makefiles used in ggk for doing a diff with the "golden" version of the generated file seems like a good model. An e-mail has been sent to Dan with the locations of the makefiles in the mgg repo.

Local Config

Need to be able to set up config files local to a project (or perhaps even to each recipe). This will allow greater customization of the final output.

Not sure where to start on this.

Problem with how fractions are printed in EqnBlock

I have the following equation in my manual SRS:

originalexprfraction

Which I attempted to code in Drasil with the following code, where items including HTC are the 'h' variables, items including SA are the 'A' variables, and items including htCap are the 'C' variables (I think the rest is self-explanatory, but let me know if anything is unclear):

EqnBlock (Deriv (C temp_W) (C time) := ((C coil_HTC) * (C coil_SA)) /
                ((C w_mass) * (C htCap_W)) * ((C temp_C) - (C temp_W)) +
                ((C coil_HTC) * (C coil_SA)) / ((C coil_HTC) * (C coil_SA)) *
                ((C pcm_HTC) * (C pcm_SA)) / ((C w_mass) * (C htCap_W)) *
                ((C temp_PCM) - (C temp_W)))

But it ended up looking like this:

exprfractionerror

The second fraction on the right side of the equation is incorrect. I can get the equation to print out correctly by rearranging the terms in my code and adding some extra brackets like so:

EqnBlock (Deriv (C temp_W) (C time) := ((C coil_HTC) * (C coil_SA)) /
                ((C w_mass) * (C htCap_W)) * ((C temp_C) - (C temp_W)) +
                (((C coil_HTC) * (C coil_SA)) * ((C pcm_HTC) * (C pcm_SA))) / 
                (((C coil_HTC) * (C coil_SA))  * ((C w_mass) * (C htCap_W))) *
                ((C temp_PCM) - (C temp_W)))

But since I think the layout of my first attempt was still correct if BEDMAS rules are followed, this might be something that should be looked into. The problem exists in both the TeX and HTML files.

Trouble with multiple paragraphs in same section

I am having trouble finding out how to start a new paragraph for cases where there are multiple paragraphs in the same section (or subsection, subsubsection, etc.) in the SRS. I tried creating two separate "Paragraph" LayoutObjs but the second one started on the same line as where the first ended, whereas I want it to start on a new, indented line. Is it possible to do that?

@szymczdm Tagging Dan because I am not sure if simply opening an issue alerts anyone.

Brooks

Representing functions in Expr

There is currently no way to represent functions in expressions. For example, representing temperature as a function of time by T(t).

Repeated description

I changed from using RelationChunk to EqChunk for the Data Definition Section since I thought I should use the information capture function that Drasil provides. But there'll be a problem if the "Equation" is actually a function. For example, as the screenshot below shows, the description for q̂tol repeats since it appears twice in this Expr.

screen shot 2016-06-24 at 3 20 06 am

For this case, should I change it back to RelationChunk since it's more like a relation instead of an equation? Or do we also need to consider about functions in EqChunk and avoid repeating? (We might need to avoid this problem since we want automation for Theoretical Model and Instance Model as well in the end.)

Quick summary of purpose of each file

Although an overview of the requirements and design of Drasil is too big a task for the moment, a quick summary of the purpose of each file would be helpful. This could be in the form of a Readme.txt file in each folder.

Mapping and interpolation

Mapping
In the Data Definitions section in "glassbr_srs.pdf" file, there is a relation which is a function that maps from t (nominal thickness) to h (minimum thickness). Details are as follows.

Location: 6.2.4 Data Definitions -> DD1
h = h(t), h(t) = (t = 2.5 => 2.16 | t = 2.7 => 2.59 | t=3.0 => 2.92 | t=4.0 => 3.78 | t=5.0 => 4.57 | t=6.0 => 5.56 | t=8.0 => 7.42 | t=10.0 => 9.02 | t=12.0 => 11.91 | t=16.0 => 15.09 | t=19.0 => 18.26 | t=22.0 => 21.44)

Interpolation
And there are 3 relations which are functions (supposed to be equations, actually using an interpolation algorithm) using their specified parameters. They are listed as follows.

  • Location: 6.2.3 Instance Models -> IM3 Equations: q = q(w_TNT, SD)
  • Location: 6.2.4 Data Definitions -> DD3 Equations: J = J(q_hat, a/b)
  • Location: 6.2.4 Data Definitions -> DD7 Equations: q_hat_tol = q_hat_tol(J_tol, a/b)

Currently, I can't enter them in Drasil as h = h(t) or q = q(w_TNT, SD) since they can't be a Relation. And the equations used for them might need further discussions.

Referencing a Theoretical Model within a Theoretical Model

Currently you can't reference a theoretical model in the description of another theoretical model, since the theoretical model LayoutObj is defined in the "Body.hs" code and the descriptions for the models are defined in the "Example.hs" code.

This could be fixed just by defining the LayoutObjs for the theoretical models in "Example.hs" instead of "Body.hs", but I'm not sure if that's something we'd be okay with doing?

Norm symbol

Currently unable to write the norm symbol (double absolute value bars) in Drasil.

Tables with many columns extend past margin

Tables with enough columns will extend past the right margin, as shown below:

drasiltableextends

It looks to me as if there is enough spacing between the columns that this table could fit within the margins if that spacing were reduced. Even if that's not the case, should the column headers wrap around to multiple lines so that the table can fit within the margins?

This problem only exists for the SRS Doctype, not the HTML files.

Additional subscripts for defined constants/variables in text/equations

I require a way of adding subscripts to the symbols of my defined constants/variables in some circumstances.

For example, a constant/variable is defined with symbol T, but I need to write the equation x = T_i - T_(i-1). Sometimes these are already subscripted, i.e. symbol T_w needs to become T_(w,i).

Physical and Software constraints in Tables

I have the following table in my SRS, which contains columns for constraints on the variables.

tablewithasterisksexample

I could make this table with drasil by typing out all of the constraints, but that would be tedious and I think it makes more sense to define the constraints on a variable when you define the variable, so that those constraints can be extracted from the variable using " ^. ".

Change Drasil to a Library

Drasil should be changed into a library so that projects can simply import it and define their own documents to generate. This will facilitate the work on the various summer projects, without a need for everyone to work directly in the literate-scientific-software repo.

More than one equation in the Instance Model table

For my case, one of the Instance Models contains two equations, like this

screen shot 2016-06-02 at 4 51 11 am

Currently there's no way to do this.
But I'm not sure if it's necessary to consider situation like this. Should I just define B in the Data Definitions section instead?

Including brackets in expressions

@szymczdm

Is there a way to include brackets in expressions (Expr) so that they will appear on the final printed product?
I've tried simply adding the brackets to the expression code, and I've tried using the " :* " operator, but neither method added brackets to the SRS document.

Brooks

Tables set to false still increase table counter

Currently, tables set to False to prevent the table caption from appearing are still considered tables by the table counter in the .tex document. This shifts the numbering for future tables that are set to True.

For example, in my SRS the first three tables do not require a caption, and are therefore set to False. My fourth table does require a caption, but when set to True the caption reads "Table 4: Input Variables" even though it is really only the first table with a caption. I think it should read "Table 1" instead.

Brooks

Add Jingwei, Brooks and Luthfi as members

So that everyone can see their drasil code, we need Jingwei, Brooks and Luthfi to have write access to the git repo. I thought I could add them, but I do not see any part of the interface that lets me add new members. Dan or Jacques, can you please do that?

Equations outside of definitions/models

I have derivation sections in my SRS which involve displaying equations outside of models or definitions. I've been using the EqnBlock LayoutObj to do this, but EqnBlocks must be formed from Sentences. Does that mean that any of the functionality that has been added or is planned to be added to Expr will not work for EqnBlocks?

For example, in the section of my SRS shown below, those equations involve derivatives. Functionality for displaying derivatives has been added to Expr, but as far as I can tell that functionality won't work here because EqnBlocks are composed of Sentences, not Exprs.

derivationexample

Quotation marks within a sentence

As discussed in the meeting on May 25th, there should be a method for adding quotation marks within a Sentence that will work for both SRS and HTML documents.

Note: I tried using " and this did indeed work for both .tex and HTML, so this might not be a real issue.

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.