Code Monkey home page Code Monkey logo

mrsimulator-app's People

Contributors

code-factor avatar deepanshs avatar dependabot[bot] avatar mgiammar avatar mvenetos97 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

mrsimulator-app's Issues

Fit or Simulate Sets Visibility of First spin_system/method

Steps to Reproduce:

  1. Create session with multiple spin_systems and/or methods
  2. Go to features tab and select a different method and/or spin_system than the first
  3. Click Simulate or Fit and table & feature select buttons default to 0.

Note: For spin_systems, this does not change the selected system under the spin_systems tab. It does, however, select the first method under the methods tab

Note: If on the second or greater page on feature select buttons (spin systems 8+), buttons do not update but the table & values does.

Sigma Value Always Resets to 1 after 'Submit Method'

NOTE: This bug only affects mrsimulator-app when running locally. The current live dev version is not affected by this issue.

Steps to reproduce:

  1. Load any example with experimental data
  2. Go to methods tab
  3. Change sigma to any valid value except 1
  4. Press the Submit Method button

Expected behavior:
Values in method fields remain the same after Submit Method is clicked

Observed behavior:
Other value remain the same, but sigma always resets to 1 regardless of given value

I believe the issue originates in these lines of code:

// noise standard deviation
if (method.experiment != null) {
let application = method.experiment.csdm.dependent_variables[0].application;
if (application == null) { application = {}; }
if (application['com.github.DeepanshS.mrsimulator'] == null) {
application['com.github.DeepanshS.mrsimulator'] = {
'sigma': 1
};
}
let sigma = application['com.github.DeepanshS.mrsimulator'].sigma;
// array.push(sigma);
setValue("measurement-sigma", sigma);
}

The application variable is always undefined meaning sigma is always set to 1 before setVaule is called.

Unexpected display when selecting a method.

Steps to reproduce.

  1. Open the example, wollastonite.
  2. Add a new method (isotope 29Si).
  3. Goto the Features tab.
  4. Run least-squares minimization. (This will raise an error as expected: LeastSquaresAnalysisError: Please attach measurement(s) for method(s) at index(es) [1] before performing the least-squares analysis.)
  5. Next, Goto the Methods tab and click on the unselected method.

Expected behavior: The screen should show the method parameters of the selected method.

What is observed: The screen jumps to the Features tab. This should not happen.

Baseline Offset is dependent on Number of Spin Systems

Steps to reproduce:

  1. Create a new document
  2. Add BlochDecaySpectrum for 1H
  3. Go to Methods tab and add Constant Baseline Offset of 1 under Signal Processing
  4. Go to Spin Systems tab
  5. Add new 1H spin system
  6. Observe baseline on the spectrum
  7. Repeat from step 5 for desired number of spin systems

Expected behavior:
The spectrum always shows a baseline at 1

Observed behavior:
The spectrum baseline is dependent on the number of spin systems. For n>1 spin systems and a defined baseline offset of b the observed offset is n*b

Fit report does not populate on certain browsers

After running a fit, the fit_report tab should update with tables displaying information about the fit. This functionality uses JavaScript and element.innerHTML to populate the page.

When mrsimulator-app is opened on Firefox, no issues arise. However on Safari and Google Chrome, the tab does not populate after a fit. Looking at the server output suggests the fit was successful and the issue arises from browsers' differences in JavaScript.

This issue probably stems from element.innerHTML.

Labeling Issue when Decomposing Spectrum

Steps to reproduce.

  1. From examples page, load Wollastonite
  2. Select the decompose spectrum button

Expected behavior: The spectrum decomposes into experiment, Q2 (3), Q2 (1), Q2 (2), and residual

Observed behavior: The spectrum decomposes into experiment, Q2 (3), Q2 (1), Q2 (2), and NMR Spectrum

NMR Spectrum is mislabeled on the graph legend

Serialization of Simulator.config.decompose_spectrum

Steps to reproduce:

  1. Create a new file in the mrsimulator-app
  2. Add two spin_systems to the file
  3. Add a method to the file
  4. Under Signal Processing add two convolutions
  5. Have the first convolution apply only to spin_system 0 and second convolution only apply to spin_system 1
  6. Apply the processor
  7. Download the simulation as a .mrsim file
  8. Replacing PATHNAME with downloaded file pathname run the following code
import mrsimulator

sim, processors, _ = mrsimulator.load("PATHNAME")
# sim.config.decompose_spectrum = "spin_system"
sim.run()

for processor, method in zip(processors, sim.methods):
    processed_data = processor.apply_operations(method.simulation).real

Expected behavior:
Downloaded data is simulated and processed without error

Observed behavior:
The last line throws IndexError: list index out of range error

Note: If line 4 is uncommented then the code runs without error

Internal JavaScript error when removing currently selected method

Steps to reproduce.

  1. Open the example, wollastonite.
  2. Add a new method (isotope 29Si).
  3. Go to Features tab (needed to load feature select buttons).
  4. Go to Methods tab.
  5. Select new method.
  6. From top menu bar, select method > Remove selection
  7. Go to Features tab.

Expected behavior: The screen changes to Features tab with 0th and only method selected.

Observed behavior: The app pauses unusually long and throws error undefined is not an object (evaluating 'list[value+1].click') and ends on Features tab.

A similar issue results when removing selected method through method > Remove selection on the fitting tab; the buttons are not updated and selecting invalid methods gives same error.

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.