GithubHelp home page GithubHelp logo

gens.jl's People

Contributors

wilcrofter avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

beheshtaein

gens.jl's Issues

Zero index

I'm calling genS with incorrect parameters but at the entry for (5,6), that is xmitr 5 and rcvr 6, a zero for the row index appears. The following code calls probePos and genS (with incorrect parameters) and prints the xmitr,rcvr pairs followed by a list of values which are linear combinations of the i,j indices associated with the pairs. For (xmitr,rcvr)==(5,6) the first entry is 0.

using GenS

function zeroRow()
r2 = Float64[-.1 8.1; -.1 -0.1; 8.1 -0.1; 8.1 8.1]
grid = .5
width = 8
height = 8
xmitr,rcvr = probePos(8,r2)
data = genS(width,height,grid,xmitr,rcvr)
for (j in 1:height)
for (i in 1:width)
col = (data[i,j][1][:,1]-1)*width + data[i,j][1][:,2]
println(i," ",j," * ",col)
end #i
end #j
end #function

Use and development of GenS

Basic installation

Installing GenS as a Julia package requires that git be installed on your system. Then, from the Julia prompt, either of the following commands should work. (Let me know if they don't.)

julia> Pkg.clone("[email protected]:WilCrofter/GenS.jl.git")

or

julia> Pkg.clone("https://github.com/WilCrofter/GenS.jl.git")

(Alternatively, if you have a GitHub account, you can fork the repository and install from the fork, replacing WilCrofter in the above commands with your own GitHub user name.)

Assuming the above commands work, GenS will be installed in Julia's package directory. Its location can be found using Pkg.dir:

julia> Pkg.dir("GenS")

To verify, package tests can be run as follows

julia> Pkg.build("GenS");Pkg.reload("GenS");Pkg.test("GenS")

which should result in output resembling:

WARNING: replacing module GenS
INFO: Testing GenS
INFO: Any["wCrossings (vert) OK" true
    "wCrossings (hor) OK" true
    "wCrossings (slant) OK" true
    "gridCrossings OK" true
    "gridCrossings time" 0.00023827
    "segmentLengths OK" true
    "segmentLenths time" 0.000338441221
    "probePos probe 1 OK" true
    "probePos probe 2 OK" true
    "IO: width OK" true
    "IO: height OK" true
    "IO: gridsize OK" true
    "IO: transmitters OK" true
    "IO: receivers OK" true
    "IO: data OK" true
    "genS I/O consistency OK" true
    "genS time (128 transducers)" 5.266795331]
INFO: GenS tests passed

Contributing and updating

The git GUI may be useful if you are unfamiliar with git. It is fairly easy to update the package from the command line or Julia prompt, however. In either case you must first navigate to the package directory (as given by julia> Pkg.dir("GenS").) In Julia:

julia> cd(Pkg.dir("GenS"))
julia> ;git pull # the semicolon causes the command to be issued to the operating system

In a terminal

cd /path/to/GenS
git pull

To contribute code, bug fixes, etc., you must be a collaborator or must issue a pull request from a forked repository. For either purpose you must have a GitHub account.

Contributors will need some familiarity with git, with the commands git add, git commit, and git push at a minimum.

Copy GenS mfiles to another location

GenS includes four m-files. The package directory is probably not the most convenient place for them. However, they are easily copied to another location. The following shows how I copy them to my desktop using the Julia function, cp. Note that * is Julia's string concatenation operator

julia> cp(Pkg.dir("GenS") * "/mfiles", "/home/wil/Desktop/mfiles")

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.