DiadFit 0.0.68__tar.gz → 0.0.69__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {DiadFit-0.0.68 → DiadFit-0.0.69}/PKG-INFO +1 -1
  2. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/_version.py +1 -1
  3. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/densimeters.py +22 -70
  4. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/importing_data_files.py +57 -0
  5. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/ne_lines.py +1 -1
  6. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/PKG-INFO +1 -1
  7. {DiadFit-0.0.68 → DiadFit-0.0.69}/README.md +0 -0
  8. {DiadFit-0.0.68 → DiadFit-0.0.69}/setup.cfg +0 -0
  9. {DiadFit-0.0.68 → DiadFit-0.0.69}/setup.py +0 -0
  10. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/CO2_EOS.py +0 -0
  11. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/CO2_in_bubble_error.py +0 -0
  12. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/H2O_fitting.py +0 -0
  13. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Highrho_polyfit_data.pkl +0 -0
  14. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Lowrho_polyfit_data.pkl +0 -0
  15. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Mediumrho_polyfit_data.pkl +0 -0
  16. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Psensor.py +0 -0
  17. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/__init__.py +0 -0
  18. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/argon_lines.py +0 -0
  19. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/cosmicray_filter.py +0 -0
  20. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/densimeter_fitting.py +0 -0
  21. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/density_depth_crustal_profiles.py +0 -0
  22. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/diads.py +0 -0
  23. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/error_propagation.py +0 -0
  24. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/SOURCES.txt +0 -0
  25. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/dependency_links.txt +0 -0
  26. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/requires.txt +0 -0
  27. {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DiadFit
3
- Version: 0.0.68
3
+ Version: 0.0.69
4
4
  Summary: DiadFit
5
5
  Home-page: https://github.com/PennyWieser/DiadFit
6
6
  Author: Penny Wieser
@@ -5,4 +5,4 @@
5
5
  # 1) we don't load dependencies by storing it in __init__.py
6
6
  # 2) we can import it in setup.py for the same reason
7
7
  # 3) we can import it into your module
8
- __version__ = '0.0.68'
8
+ __version__ = '0.0.69'
@@ -585,30 +585,36 @@ def merge_in_carb_SO2(df_combo, file1_name='Carb_Peak_fits.xlsx', file2_name='SO
585
585
  return df_combo_sec_phase
586
586
 
587
587
  ## Merge peak fits together
588
- def merge_fit_files():
588
+ def merge_fit_files(path):
589
589
  """
590
590
  This function merges the files Discarded_df.xlsx, Weak_Diads.xlsx, Medium_Diads.xlsx, Strong_Diads.xlsx
591
591
  if they exist into one combined dataframe
592
592
  """
593
- import os.path
594
- from os import path
595
- if path.exists('Discarded_df.xlsx'):
596
- discard=pd.read_excel('Discarded_df.xlsx')
593
+ import os
594
+ import pandas as pd
595
+
596
+ if os.path.exists(os.path.join(path, 'Discarded_df.xlsx')):
597
+ discard = pd.read_excel(os.path.join(path, 'Discarded_df.xlsx'))
597
598
  else:
598
- discard=None
599
- if path.exists('Weak_Diads.xlsx'):
600
- grp1=pd.read_excel('Weak_Diads.xlsx')
599
+ discard = None
600
+
601
+ if os.path.exists(os.path.join(path, 'Weak_Diads.xlsx')):
602
+ grp1 = pd.read_excel(os.path.join(path, 'Weak_Diads.xlsx'))
601
603
  else:
602
- grp1=None
603
- if path.exists('Medium_Diads.xlsx'):
604
- grp2=pd.read_excel('Medium_Diads.xlsx')
604
+ grp1 = None
605
+
606
+ if os.path.exists(os.path.join(path, 'Medium_Diads.xlsx')):
607
+ grp2 = pd.read_excel(os.path.join(path, 'Medium_Diads.xlsx'))
605
608
  else:
606
- grp2=None
607
- if path.exists('Strong_Diads.xlsx'):
608
- grp3=pd.read_excel('Strong_Diads.xlsx')
609
+ grp2 = None
610
+
611
+ if os.path.exists(os.path.join(path, 'Strong_Diads.xlsx')):
612
+ grp3 = pd.read_excel(os.path.join(path, 'Strong_Diads.xlsx'))
609
613
  else:
610
- grp3=None
611
- df2=pd.concat([grp1, grp2, grp3], axis=0).reset_index(drop=True)
614
+ grp3 = None
615
+
616
+ df2 = pd.concat([grp1, grp2, grp3], axis=0).reset_index(drop=True)
617
+
612
618
  if discard is not None:
613
619
  discard_cols=discard[discard.columns.intersection(df2.columns)]
614
620
  df2=pd.concat([df2, discard_cols]).reset_index(drop=True)
@@ -616,57 +622,3 @@ def merge_fit_files():
616
622
 
617
623
 
618
624
 
619
- ## Save settings files
620
- def save_settings(meta_path, spectra_path, filetype, prefix, prefix_str, file_ext, TruPower):
621
- # Get the current folder
622
- folder = os.getcwd()
623
-
624
- # Create the settings dictionary
625
- settings = {
626
- 'meta_path': meta_path,
627
- 'spectra_path': spectra_path,
628
- 'filetype': filetype,
629
- 'prefix': prefix,
630
- 'prefix_str': repr(prefix_str),
631
- 'file_ext': file_ext,
632
- 'TruPower': TruPower,
633
- }
634
-
635
- # Construct the settings file path
636
- settings_file_path = os.path.join(folder, 'settings.txt')
637
-
638
- # Write the settings to the file
639
- with open(settings_file_path, 'w') as file:
640
- for key, value in settings.items():
641
- file.write(f"{key}={value}\n")
642
-
643
- def get_settings():
644
- # Get the current folder
645
- folder = os.getcwd()
646
-
647
- # Construct the settings file path
648
- settings_file_path = os.path.join(folder, 'settings.txt')
649
-
650
- # Read the settings from the file
651
- settings = {}
652
- with open(settings_file_path, 'r') as file:
653
- for line in file:
654
- line = line.strip()
655
- if line:
656
- key, value = line.split('=')
657
- settings[key] = value
658
- if key == 'prefix_str':
659
- value = eval(value) # Evaluate the string to retrieve the original value
660
- settings[key] = value
661
-
662
- if 'prefix' in settings:
663
- settings['prefix'] = settings['prefix'].lower() == 'true'
664
-
665
- if 'TruPower' in settings:
666
- settings['TruPower'] = settings['TruPower'].lower() == 'true'
667
-
668
- # Return the settings
669
- return settings.get('meta_path'), settings.get('spectra_path'), settings.get('filetype'), \
670
- settings.get('prefix'), settings.get('prefix_str'), settings.get('file_ext'), settings.get('TruPower')
671
-
672
-
@@ -1175,3 +1175,60 @@ def stitch_loop_individual_fits(*, fit_individually=True,
1175
1175
  df_Dense_Combo=df_Dense
1176
1176
 
1177
1177
  return df_Dense_Combo
1178
+
1179
+
1180
+ ## Save settings files
1181
+ def save_settings(meta_path, spectra_path, filetype, prefix, prefix_str, file_ext, TruPower):
1182
+ # Get the current folder
1183
+ folder = os.getcwd()
1184
+
1185
+ # Create the settings dictionary
1186
+ settings = {
1187
+ 'meta_path': meta_path,
1188
+ 'spectra_path': spectra_path,
1189
+ 'filetype': filetype,
1190
+ 'prefix': prefix,
1191
+ 'prefix_str': repr(prefix_str),
1192
+ 'file_ext': file_ext,
1193
+ 'TruPower': TruPower,
1194
+ }
1195
+
1196
+ # Construct the settings file path
1197
+ settings_file_path = os.path.join(folder, 'settings.txt')
1198
+
1199
+ # Write the settings to the file
1200
+ with open(settings_file_path, 'w') as file:
1201
+ for key, value in settings.items():
1202
+ file.write(f"{key}={value}\n")
1203
+
1204
+ def get_settings():
1205
+ # Get the current folder
1206
+ folder = os.getcwd()
1207
+
1208
+ # Construct the settings file path
1209
+ settings_file_path = os.path.join(folder, 'settings.txt')
1210
+
1211
+ # Read the settings from the file
1212
+ settings = {}
1213
+ with open(settings_file_path, 'r') as file:
1214
+ for line in file:
1215
+ line = line.strip()
1216
+ if line:
1217
+ key, value = line.split('=')
1218
+ settings[key] = value
1219
+ if key == 'prefix_str':
1220
+ value = eval(value) # Evaluate the string to retrieve the original value
1221
+ settings[key] = value
1222
+
1223
+ if 'prefix' in settings:
1224
+ settings['prefix'] = settings['prefix'].lower() == 'true'
1225
+
1226
+ if 'TruPower' in settings:
1227
+ settings['TruPower'] = settings['TruPower'].lower() == 'true'
1228
+
1229
+ # Return the settings
1230
+ return settings.get('meta_path'), settings.get('spectra_path'), settings.get('filetype'), \
1231
+ settings.get('prefix'), settings.get('prefix_str'), settings.get('file_ext'), settings.get('TruPower')
1232
+
1233
+
1234
+
@@ -670,7 +670,7 @@ const_params=True, spec_res=0.4) :
670
670
 
671
671
  df=pd.DataFrame(data={'Xdata': xdat,
672
672
  'Ydata': ydat})
673
- df.to_clipboard(excel=True)
673
+ #df.to_clipboard(excel=True)
674
674
 
675
675
  # This defines the range you want to fit (e.g. how big the tails are)
676
676
  lower_pk1=Ne_center+x_span[0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DiadFit
3
- Version: 0.0.68
3
+ Version: 0.0.69
4
4
  Summary: DiadFit
5
5
  Home-page: https://github.com/PennyWieser/DiadFit
6
6
  Author: Penny Wieser
File without changes
File without changes
File without changes
File without changes