Git Product home page Git Product logo

aide_draw-deprecated's Introduction

aguaclara

Pypi Version Documentation Build Status Code Coverage

aguaclara is a Python package developed by AguaClara Cornell and AguaClara Reach for designing and performing research on AguaClara water treatment plants. The package has several main functionalities:

  • DESIGN of AguaClara water treatment plant components
  • MODELING of physical, chemical, and hydraulic processes in water treatment
  • PLANNING of experimental setup for water treatment research
  • ANALYSIS of data collected by ProCoDA (process control and data acquisition tool)

Installing

The aguaclara package can be installed from Pypi by running the following command in the command line:

pip install aguaclara

To upgrade an existing installation, run

pip install aguaclara --upgrade

Using aguaclara

aguaclara's main functionalities come from several sub-packages.

  1. Core: fundamental physical, chemical, and hydraulic functions and values
  2. Design: modules for designing components of an AguaClara water treatment plant
  3. Research: modules for process modeling, experimental design, and data analysis in AguaClara research

To use aguaclara's registry of scientific units (based on the Pint package), use from aguaclara.core.units import u. Any other function or value in a sub-package can be accessed by importing the package itself:

Example Usage: Design

import aguaclara as ac
from aguaclara.core.units import u

# Design a water treatment plant
plant = ac.Plant(
    q = 40 * u.L / u.s,
    cdc = ac.CDC(coag_type = 'pacl'),
    floc = ac.Flocculator(hl = 40 * u.cm),
    sed = ac.Sedimentor(temp = 20 * u.degC),
    filter = ac.Filter(q = 20 * u.L / u.s)
)

Example Usage: Core

# continued from Example Usage: Design

# Model physical, chemical, and hydraulic properties 
cdc = plant.cdc
coag_tube_reynolds_number = ac.re_pipe(
    FlowRate = cdc.coag_q_max,
    Diam = cdc.coag_tube_id,
    Nu = cdc.coag_nu(cdc.coag_stock_conc, cdc.coag_type)
)

Example Usage: Research

import aguaclara as ac
from aguaclara.core.units import u
import matplotlib.pyplot as plt

# Plan a research experiment
reactor = ac.Variable_C_Stock(
    Q_sys = 2 * u.mL / u.s, 
    C_sys = 1.4 * u.mg / u.L, 
    Q_stock = 0.01 * u.mL / u.s
)
C_stock_PACl = reactor.C_stock()

# Visualize and analyze ProCoDA data
ac.iplot_columns(
    path = "https://raw.githubusercontent.com/AguaClara/team_resources/master/Data/datalog%206-14-2018.xls", 
    columns = [3, 4], 
    x_axis = 0
)
plt.ylabel("Turbidity (NTU)")
plt.xlabel("Time (hr)")
plt.legend(("Influent", "Effluent"))

The package is still undergoing rapid development. As it becomes more stable, a user guide will be written with more detailed tutorials. At the moment, you can find some more examples in specific pages of the API reference.

Contributing

Bug reports, features requests, documentation updates, and any other enhancements are welcome! To suggest a change, make an issue in the aguaclara Github repository.

To contribute to the package as a developer, refer to the Developer Guide.

aide_draw-deprecated's People

Contributors

eak24 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aide_draw-deprecated's Issues

Write a FeatureScript LFOM hole patterner

@Anishka99 let's see if we can write a nice LFOM hole pattern feature. Here are three permutations of the feature. Start with the first (the simplest), and work up to the most complex (but also the most versatile!)

  1. Given a direction and a number of rows, pattern a hole (either a face pattern or a feature pattern) in that direction. To do this, just use a linear pattern written in featurescript.
  2. Take in an array that specifies the number of holes on each "row". Now each row of the linear pattern should be patterned to have the number of holes specified in a circular pattern around the pipe.
  3. Offset the rows such that each row up is 'nestled' between the holes of the row below.
  4. Take in a hole diameter and spacing to the feature.

deep_copy

We need a function that takes the current design and performs a deep copy. This means copying all subassemblies. Can be done by exporting as an f3z, than importing as an f3z. See this video for an example.

document designs

We need to ensure that we are making drawings as well as models so that the designs auto document. This is really a job for aide_document.

Support mechanism for fine-tuning features/components

We need something other than dp that will let us control features/components in greater detail. For instance, we need to be able to suppress features as in the LFOM, and we need to be able to do this dynamically. Now I don't want to manage all the little pieces of code required if we had a bunch of independent methods for handling different features. Instead, I want to expose a window from the aide_design yaml directly to the fusion api.

YAML MVP Number One

The first MVP will accomplish three things:

  • Create a YAML file based on parameters in an assembly - this will hunt through all the sub-assemblies and pull out every single parameter and turn it into a nested YAML file.
  • Sync that YAML file with the model - this only goes one way - bringing the model up to date such that you could have changed the parameters on the YAML, and the model will change correspondingly.
  • The YAML needs to support referencing other parameters and simple mathematics.

Develop a template drawing package

The plant will rely on geometric relationships defined in templates. This means that keeping careful track of which templates are used for which AIDE version is critical. These templates need to be able to be packaged up and shipped along with the rest of the AIDE plugin. Some questions are:

  • How do normal plugins ship template drawings?
  • Does Fusion have a standard method for this? Maybe ask on some community forum if you can't find the answer online.

Afterwards, it might be useful to try creating such a plugin - perhaps just one that modifies the dimensions of a square that is defined in a template. This plugin seems to be highly relevant and a great place to start

OnShape connector

This morning I spent about 2.5 hours to figure out whether or not we could use OnShape as another CAD system. It has a number of benefits - it is 100% cloud based, supports by default configurations, etc... The goal is to have an onshape system that can do exactly the same thing as aide_draw for Fusion. I explored with this repo. To do this, I think I'll need to make the following REST calls: Assembly: Assembly definition to figure out what instances are there and get the configuration strings example:

{
  "rootAssembly" : {
    "documentId" : "8ec353ba00f37f447b5a61f5",
    "documentMicroversion" : "e948bc1ade7c5ab16ae07f95",
    "elementId" : "1a1dbfb527f96cc00c05e2ed",
    "occurrences" : [ {
      "path" : [ "MLER6gjKXbnv2zVXS" ],
      "transform" : [ 1.0, 0.0, 0.0, -0.06718311458826065, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, -0.6096, 0.0, 0.0, 0.0, 1.0 ],
      "fixed" : false,
      "hidden" : false
    } ],
    "instances" : [ {
      "id" : "MLER6gjKXbnv2zVXS",
      "name" : "Part 1 <1>",
      "partId" : "JHD",
      "isStandardContent" : false,
      "configuration" : "height=1.2192+meter;poo=true",
      "type" : "Part",
      "suppressed" : false,
      "documentId" : "8ec353ba00f37f447b5a61f5",
      "documentMicroversion" : "e948bc1ade7c5ab16ae07f95",
      "elementId" : "2918f0f5adfa39d3047f19d0"
    } ]
  },
  "subAssemblies" : [ ],
  "parts" : [ {
    "documentId" : "8ec353ba00f37f447b5a61f5",
    "documentMicroversion" : "e948bc1ade7c5ab16ae07f95",
    "elementId" : "2918f0f5adfa39d3047f19d0",
    "partId" : "JHD",
    "bodyType" : "solid",
    "configuration" : "height=1.2192+meter;poo=true",
    "isStandardContent" : false
  } ],
  "partStudioFeatures" : [ ]
}

Now I can insert another partstudio with whatever configuration I want with a call to "create assembly instance":

{
  "documentId": "8ec353ba00f37f447b5a61f5",
  "elementId": "2918f0f5adfa39d3047f19d0",
  "versionId": "",
  "microversionId": "",
  "isAssembly": false,
  "isWholePartStudio": true,
  "partId": "",
  "featureId": "",
  "configuration": "height=1+meter;poo=true"
}

Decode/Encode configuration String seem to be handy. To upload the new configuration to the assembly, we'll need to copy the elementID of the part, and then update the config...

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.