Skip to content

Commit

Permalink
Now using poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
holukas committed Mar 20, 2023
1 parent 13ece7d commit 7bc7659
Show file tree
Hide file tree
Showing 16 changed files with 396 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .idea/FLUXRUN_Flux_Calcs.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

![](images/logo_FLUXRUN1_256px.png)

## v1.2.0 - 20 Mar 2023

- Now using `poetry` as dependency manager
- Removed `setup.py`, not needed with `poetry`
- Removed `environment.yml`, not needed with `poetry`
- Removed `start_fluxrun.py`, GUI is now started with CLI `-g` flag

## v1.1.1 - 18 Dec 2022

- Fixed bug where calculations from previously uncompressed `.csv.gz` files would not
Expand Down
65 changes: 0 additions & 65 deletions environment.yml

This file was deleted.

8 changes: 6 additions & 2 deletions fluxrun/gui/gui_elements.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtCore as qtc
from PyQt5 import QtWidgets as qtw
from PyQt5.QtGui import QIntValidator


def add_label_combobox_to_grid(label, grid, row, items: list):
lbl = qtw.QLabel(label)
cmb = qtw.QComboBox()
Expand All @@ -18,6 +19,7 @@ def add_label_datetimepicker_to_grid(label, grid, row):
grid.addWidget(datetimepicker, row, 1)
return datetimepicker


def add_label_lineedit_to_grid(label, grid, row, value, only_int=False):
lbl = qtw.QLabel(label)
lineedit = qtw.QLineEdit(value)
Expand All @@ -30,20 +32,22 @@ def add_label_lineedit_to_grid(label, grid, row, value, only_int=False):
grid.addWidget(lineedit, row, 1, 1, 1)
return lineedit


def add_checkbox_to_grid(label, grid, row):
checkbox = qtw.QCheckBox(label)
grid.addWidget(checkbox, row, 0)
return checkbox


def add_button_to_grid(label, grid, row, colspan=1):
button = qtw.QPushButton(label)
grid.addWidget(button, row, 0, 1, colspan)
return button


def add_label_link_to_grid(link_txt, link_str, grid, row, colspan=1):
label_link = qtw.QLabel(f"<a href='{link_str}'>{link_txt}</a>\n")
label_link.setProperty('labelClass', 'label_link')
label_link.setAlignment(qtc.Qt.AlignCenter | qtc.Qt.AlignVCenter)
grid.addWidget(label_link, row, 0, 1, colspan)
return label_link

2 changes: 0 additions & 2 deletions fluxrun/ops/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
from pathlib import Path


def validate_args(args):
Expand Down Expand Up @@ -46,6 +45,5 @@ def get_args():
# help="Avoid duplicates: skip files that share the same filename as a file that is already "
# "available in FOLDER.")


args = parser.parse_args()
return args
8 changes: 4 additions & 4 deletions fluxrun/ops/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ def prepare_app(self):
# Check if files available
if not Path(self.settings_dict['_path_used_eddypro_app_rp']).is_file():
self.logger.info(f"(!)ERROR eddypro_rp.exe was not found "
f"in folder {self.settings_dict['_dir_out_run_eddypro_bin']}")
f"in folder {self.settings_dict['_dir_out_run_eddypro_bin']}")
sys.exit(-1)

if not Path(self.settings_dict['_path_used_eddypro_app_fcc']).is_file():
self.logger.info(f"(!)ERROR eddypro_fcc was not found "
f"in folder {self.settings_dict['_dir_out_run_eddypro_bin']}")
f"in folder {self.settings_dict['_dir_out_run_eddypro_bin']}")
sys.exit(-1)

def prepare_processing_file(self):
Expand Down Expand Up @@ -370,7 +370,7 @@ def __init__(self, filepath):
def run(self):
# Check header vs data
more_data_cols_than_header_cols, num_missing_header_cols, \
header_cols_list, generated_missing_header_cols_list = \
header_cols_list, generated_missing_header_cols_list = \
self.compare_len_header_vs_data(filepath=self.filepath,
skip_rows_list=self.DATA_SKIP_ROWS,
header_rows_list=self.DATA_HEADER_ROWS)
Expand Down Expand Up @@ -469,7 +469,7 @@ def compare_len_header_vs_data(self, filepath, skip_rows_list, header_rows_list)
header_cols_list.append(missing_col)

return more_data_cols_than_header_cols, num_missing_header_cols, \
header_cols_list, generated_missing_header_cols_list
header_cols_list, generated_missing_header_cols_list

def make_timestamp_microsec_suffix(self):
now_time_dt = dt.datetime.now()
Expand Down
3 changes: 0 additions & 3 deletions fluxrun/ops/setup_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,3 @@ def generate_run_id():
run_id = time.strftime("%Y%m%d-%H%M%S")
run_id = f"FR-{run_id}"
return run_id



1 change: 0 additions & 1 deletion fluxrun/ops/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from matplotlib.ticker import MultipleLocator

from ops.file import ReadEddyProFullOutputFile
from ops.file import SearchAll

pd.set_option('display.width', 1000)
pd.set_option('display.max_columns', 15)
Expand Down
60 changes: 30 additions & 30 deletions fluxrun/settings/FluxRun.settings
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
_run_id=FR-20221218-133726
_run_id=FR-20230320-224726


# INSTRUMENTS
# ===========

## Site
site=CH-DAV
site=CH-FRU


# PROCESSING
# ==========

## Raw Data Source Folder
rawdata_indir=F:/01-NEW/IRGACOMP/DAV/NON-ICOS/2013_2__IRGA7572/fluxrun/IRGA72_CH-DAV_FR-20221215-173345_OPENLAG/1-0_rawdata_files_ascii
rawdata_file_compression=None
rawdata_indir=L:/Sync/luhk_work/20 - CODING/23 - FLUX/fluxrun/_tests/XXX2
rawdata_file_compression=gzip

## Time Range
rawdata_start_date=2012-12-31 00:01
rawdata_end_date=2017-01-01 00:01
rawdata_start_date=2022-01-01 00:01
rawdata_end_date=2022-01-31 23:59

## File Settings
rawdata_filename_datetime_format=yyyymmddHHMM
_sitefiles_search_str=CH-DAV_*.csv
_sitefiles_parse_str=CH-DAV_%Y%m%d%H%M.csv
_sitefiles_search_str=CH-FRU_*.csv.gz
_sitefiles_parse_str=CH-FRU_%Y%m%d%H%M.csv.gz

## EddyPro
path_selected_eddypro_processing_file=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_2013_2_[IRGA75]_R350-A+IRGA75-A+IRGA72-B_OPENLAG.eddypro
_path_used_eddypro_processing_file=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\ini\processing.eddypro
_path_found_eddypro_metadata_file=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_2013_2_[IRGA75]_R350-A+IRGA75-A+IRGA72-B_OPENLAG.eddypro
_path_used_eddypro_metadata_file=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\ini\CH-DAV_2013_2_[IRGA75]_R350-A+IRGA75-A+IRGA72-B_OPENLAG.metadata
_path_used_eddypro_app_rp=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\bin\eddypro_rp.exe
_path_used_eddypro_app_fcc=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\bin\eddypro_fcc.exe
path_selected_eddypro_processing_file=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_2022_[IRGA75]_R350-A+IRGA75-A.eddypro
_path_used_eddypro_processing_file=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\ini\processing.eddypro
_path_found_eddypro_metadata_file=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_2022_[IRGA75]_R350-A+IRGA75-A.eddypro
_path_used_eddypro_metadata_file=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\ini\CH-FRU_2022_[IRGA75]_R350-A+IRGA75-A.metadata
_path_used_eddypro_app_rp=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\bin\eddypro_rp.exe
_path_used_eddypro_app_fcc=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\bin\eddypro_fcc.exe

# OUTPUT
# ======

## Output Folder
dir_out=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun
_dir_out_run=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726
_dir_out_run_log=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\0_log
_dir_out_run_rawdata_ascii_files=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\1-0_rawdata_files_ascii
_dir_used_rawdata_ascii_files_eddypro_data_path=F:/01-NEW/IRGACOMP/DAV/NON-ICOS/2013_2__IRGA7572/fluxrun/IRGA72_CH-DAV_FR-20221215-173345_OPENLAG/1-0_rawdata_files_ascii
_dir_out_run_plots_availability_rawdata=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\1-1_rawdata_plots_availability
_dir_out_run_plots_aggregates_rawdata=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\1-2_rawdata_plots_aggregates
_dir_out_run_eddypro=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations
_dir_out_run_eddypro_ini=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\ini
_dir_out_run_eddypro_bin=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\bin
_dir_out_run_eddypro_results=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-0_eddypro_flux_calculations\results
_dir_out_run_plots_summary=F:\01-NEW\IRGACOMP\DAV\NON-ICOS\2013_2__IRGA7572\fluxrun\CH-DAV_FR-20221218-133726\2-1_eddypro_flux_calculations_summary_plots
dir_out=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2
_dir_out_run=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726
_dir_out_run_log=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\0_log
_dir_out_run_rawdata_ascii_files=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\1-0_rawdata_files_ascii
_dir_used_rawdata_ascii_files_eddypro_data_path=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\1-0_rawdata_files_ascii
_dir_out_run_plots_availability_rawdata=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\1-1_rawdata_plots_availability
_dir_out_run_plots_aggregates_rawdata=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\1-2_rawdata_plots_aggregates
_dir_out_run_eddypro=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations
_dir_out_run_eddypro_ini=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\ini
_dir_out_run_eddypro_bin=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\bin
_dir_out_run_eddypro_results=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-0_eddypro_flux_calculations\results
_dir_out_run_plots_summary=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\_tests\XXX2\CH-FRU_FR-20230320-224726\2-1_eddypro_flux_calculations_summary_plots

## Plots
plot_availability_rawdata=1
Expand All @@ -59,7 +59,7 @@ plot_summary=1
# =======

## General
_dir_root=F:\Dropbox\luhk_work\20 - CODING\23 - FLUX
_dir_fluxrun=F:\Dropbox\luhk_work\20 - CODING\23 - FLUX\fluxrun
_dir_script=F:\Dropbox\luhk_work\20 - CODING\23 - FLUX\fluxrun\fluxrun
_dir_settings=F:\Dropbox\luhk_work\20 - CODING\23 - FLUX\fluxrun\fluxrun\settings
_dir_root=L:\Sync\luhk_work\20 - CODING\23 - FLUX
_dir_fluxrun=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun
_dir_script=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\fluxrun
_dir_settings=L:\Sync\luhk_work\20 - CODING\23 - FLUX\fluxrun\fluxrun\settings
Loading

0 comments on commit 7bc7659

Please sign in to comment.