Git Product home page Git Product logo

cs417-in-python's People

Contributors

etkeys avatar

Watchers

 avatar

cs417-in-python's Issues

Add option to control when additional extra result information is printed

Currently, the result vector is always printed. Because of this CI/CD steps redirect stdout to /dev/null. Add an option to control if the result vector should be printed or not. This can make it so CI/CD work can show more interesting result stats without the almost pointless result vector.

Find a better way to do the lookup for solvers by name

src.solvers.__init__.get_solver_instance_by_name

Right now, its a simple if..elif block the does the mapping of a string to the actual Solver implementor. There should be a more expressive way to do this. Perhaps a dictionary mapping?

Perhaps use a form of get_solver_list to map _Solver.get_solver_name() to the actual instance?

Can TestMakeEntryPoint._setup_with_directoy be made more generic?

tests.entry_points.make_tests.TestMakeEntryPoint._setup_with_directory

The real goal of this function is to act as a "setup" or "teardown" type method. Currently it only implements a "delete directory" operation, but it isn't really only for use with test_with_directory.

Add handling for converting legacy omega.def files

Part of assignment 3 uses an omega.def file to pass in the omega value to use. matrix_operations.load_files() and matrix_operations.write_files() needs to be updated to handle the conversion process from legacy to new format and for retrieve omega as a float type where needed.

Create DivergentSolution error

The ComplexResult class was introduced to handle solvers that produced divergent solutions, the LAME_CONVERGENT caveat. Going forward, a ComplexResult type of structure will be needed but all LAME_CONVERGENT results should just raise a custom DivergentSolutionError exception.

Also, a new exit code should be created to indicate to CLI that the solver produced a divergent solution which is different than a general error.

Remove TODO comments that are no longer needed

  • src.matrix_operations.to_reduced_row_echelon; While this function is only used by GaussianSolver, it's not hurting anything by staying where it is.
  • src.solve.main; Additional printing output was added in a1.0. This comment was never removed.

Restructure unit tests

Currently, to run individual tests requires a command like this:

python -m unittest tests.matrix_operations_tests.TestMatrixOperations.test_XXXXXXXXX

The TestMatrixOperations bit seems excessive. If a module only contains one class, then the TestXXXXXX class serves no purpose. What can be done to restructure the tests to remove the need to have the TestXXXXXXX class???

Possibly change to pytest? It seems to use a class-less paradigm. For reference, see thefuck (especially this module that defines a special _args method to use in a fixtures that takes overrides to default parameter to supply to a test.

Can use of `np.array()` in tests be generalized?

Original comment from [gaussian_tests](https://github.com/etkeys/cs417-in-python/blob/a2.0/python/tests/solvers/gaussian_tests.py#L50].

Some of the data for test cases don't really need to use floats to define the values in a matrix. But in order for calculations and comparisons to work correctly a matrix must be explicitly created using dtype=float (see ludecomposition_tests for example). Without explicity using dtype=float, datatype of the matrix is implied. This can cause unexpected behavior when using np.array(). When creating a matrix from test data, all tests should be able to call a general function that will call np.array with dtype=float.

Make the default output location for `make` action a constant

exp_dir is hard coded to /tmp/makemat. What if the this location changes or how this location is determined changes? This value should be made a constant so at least there is one sole source for this value.

Also, the scripts in python/.scripts hard code this value and some of the test data in tests/test_data. How can these values be updated to some constant that is defined some where else?

Add create_ones methods to matrix operations

During refactoring of tests for pre-assignment-3, attempted to reduce direct use of numpy library and instead tried to leverage functions in matrix_operations. In test_ludecomposition.py, there is a use of numpy.ones() function which doesn't have a wrapper methon in matrix_operations.

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.