Code Monkey home page Code Monkey logo

Comments (6)

mdaeron avatar mdaeron commented on July 20, 2024

NB: for now, the following ugly hack does the job.

from D47crunch import *

rawdata = D47data()
rawdata.Nominal_D48 = {
	'ETH-1': 0.138,
	'ETH-2': 0.138,
	'ETH-3': 0.270,
	'ETH-4': 0.223,
	}

rawdata.read('D48hack.csv')
rawdata.wg()
rawdata.crunch()

# temporarily replace all 47 values with 48 values
rawdata._Nominal_D47 = rawdata.Nominal_D47.copy()
rawdata.Nominal_D47 = rawdata.Nominal_D48.copy()

for r in rawdata:
	r['_D47raw'] = r['D47raw']
	r['_d47'] = r['d47']
	r['D47raw'] = r['D48raw']
	r['d47'] = r['d48']

rawdata.refresh()
rawdata.standardize()

D48_results = {}
D48_results['r_D48'] = rawdata.repeatability['r_D47']
D48_results['r_D48a'] = rawdata.repeatability['r_D47a']
D48_results['r_D48u'] = rawdata.repeatability['r_D47u']
for u in rawdata.unknowns:
	D48_results[u] = {
		'D48': rawdata.unknowns[u]['D47'],
		'SE_D48': rawdata.unknowns[u]['SE_D47'],
		}

print()
for k in D48_results:
	print(f'{k:>8}: {D48_results[k]}')

This should generate the following output:

   r_D48: 0.1237838550727198
  r_D48a: 0.13195328760301325
  r_D48u: 0.10585573189123085
   DVH-2: {'D48': 0.2575489652935696, 'SE_D48': 0.03312408958860156}
   LGB-2: {'D48': 0.30499761247804147, 'SE_D48': 0.03712619158271187}

D48hack.csv

from d47crunch.

mdaeron avatar mdaeron commented on July 20, 2024

Just pushed a new branch, D48, which defines a D48data class analogous to D47data. This is yet another approach, based on the idea that in practice, Δ47 and Δ48 standardizations are mathematically independent (granted, scrambling corrections are likely to be the same, but let's ignore that for now).

The new branch seems to work as intended when doing this:

from D47crunch import *

rawdata = D47data()
rawdata.read('D48test.csv')
rawdata.wg()
rawdata.crunch()
rawdata.standardize()
rawdata.summary()
rawdata.table_of_sessions()
rawdata.table_of_samples()
rawdata.table_of_analyses()
rawdata.plot_sessions()

rawdata = D48data(rawdata)
rawdata.standardize()
rawdata.summary()
rawdata.table_of_sessions()
rawdata.table_of_samples()
rawdata.table_of_analyses()
rawdata.plot_sessions()

Please feel free to experiment and report any issues.

from d47crunch.

MattiaTag avatar MattiaTag commented on July 20, 2024

Hi!

I have been using the new version of the code and everything seems to run smoothly. However, today I run into a problem switching to the ""indep_sessions" method.
Here the traceback:

"Traceback (most recent call last):
File "/Users/mattiatag/Documents/Python Works/Standards Monitoring/Reference Frame.py", line 236, in
corrected = correction(path)
File "/Users/mattiatag/Documents/Python Works/Standards Monitoring/Reference Frame.py", line 31, in correction
clumpy.standardize(method = "indep_sessions")
File "/Users/mattiatag/.conda/envs/Science/lib/python3.9/site-packages/D4xCrunch/init.py", line 439, in newfun
out = oldfun(*args, **kwargs)
File "/Users/mattiatag/.conda/envs/Science/lib/python3.9/site-packages/D4xCrunch/init.py", line 1161, in standardize
r[f'wD{self._4x}'] /= (a + a2 * r['t'])
KeyError: 'wD47'

Process finished with exit code 1

from d47crunch.

mdaeron avatar mdaeron commented on July 20, 2024

@MattiaTag can you try again with the current version (d4288ca) of the dev branch? I believe this bug was recently corrected.

from d47crunch.

MattiaTag avatar MattiaTag commented on July 20, 2024

Yes, it works fine in the new version!

from d47crunch.

mdaeron avatar mdaeron commented on July 20, 2024

Closed following v2.0 release.

from d47crunch.

Related Issues (15)

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.