Skip to content

Commit

Permalink
Enable example download & Version 1.0.8 (#380)
Browse files Browse the repository at this point in the history
* Enable example download

* Set to next strandesign package

* Bump to version 1.0.8
  • Loading branch information
Paulocracy authored Jun 7, 2022
1 parent 6648d22 commit ffd4def
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ We use conda as package manager to install CNApy. You can use [miniconda](https:

3. Create a conda environment with all dependencies
```sh
conda create -n cnapy-1.0.7 -c conda-forge -c cnapy cnapy=1.0.7
conda create -n cnapy-1.0.8 -c conda-forge -c cnapy cnapy=1.0.8
```

4. Activate the cnapy conda environment
```sh
conda activate cnapy-1.0.7
conda activate cnapy-1.0.8
```

5. Run CNApy
Expand Down
2 changes: 1 addition & 1 deletion cnapy/appdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AppData:
''' The application data '''

def __init__(self):
self.version = "cnapy-1.0.7"
self.version = "cnapy-1.0.8"
self.format_version = 1
self.unsaved = False
self.project = ProjectData()
Expand Down
17 changes: 9 additions & 8 deletions cnapy/gui_elements/download_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def __init__(self, appdata: AppData):

label_line = QVBoxLayout()
label = QLabel(
"CNApy could not find a projects directory.")
label_line.addWidget(label)
label = QLabel(
"Should CNApy create a projects directory and download example projects?")
"Should CNApy download the CNApy example projects to your configured CNApy projects directory?\n"
"If you didn't set a working directory yet, you can do it unter 'Config->Configure CNApy'.\n"
"Note: You can always change the projects directory in CNApy's configuration."
)
label_line.addWidget(label)
self.layout.addItem(label_line)

button_line = QHBoxLayout()
self.download_btn = QPushButton("Yes, create directory")
self.close = QPushButton("No, skip")
self.download_btn = QPushButton("Yes, download examples")
self.close = QPushButton("No, close")
button_line.addWidget(self.download_btn)
button_line.addWidget(self.close)
self.layout.addItem(button_line)
Expand All @@ -43,8 +43,9 @@ def __init__(self, appdata: AppData):

def download(self):
work_directory = self.appdata.work_directory
print("Create work directory:", work_directory)
os.mkdir(work_directory)
if not os.path.exists(work_directory):
print("Create uncreated work directory:", work_directory)
os.mkdir(work_directory)

targets = ["all_cnapy_projects.zip"]
for t in targets:
Expand Down
13 changes: 9 additions & 4 deletions cnapy/gui_elements/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def __init__(self, appdata: AppData):
self.file_menu.addAction(export_sbml_action)
export_sbml_action.triggered.connect(self.export_sbml)

download_examples = QAction("Download CNApy example projects...", self)
self.file_menu.addAction(download_examples)
download_examples.triggered.connect(self.download_examples)

exit_action = QAction("Exit", self)
exit_action.setShortcut("Ctrl+Q")
self.file_menu.addAction(exit_action)
Expand Down Expand Up @@ -564,10 +568,6 @@ def show_config_dialog(self):
dialog = ConfigDialog(self.appdata)
dialog.exec_()

def show_download_dialog(self):
dialog = DownloadDialog(self.appdata)
dialog.exec_()

@Slot()
def show_config_cobrapy_dialog(self):
dialog = ConfigCobrapyDialog(self.appdata)
Expand Down Expand Up @@ -605,6 +605,11 @@ def export_sbml(self):

self.setCursor(Qt.ArrowCursor)

@Slot()
def download_examples(self):
dialog = DownloadDialog(self.appdata)
dialog.exec_()

@Slot()
def load_box_positions(self):
dialog = QFileDialog(self)
Expand Down
2 changes: 1 addition & 1 deletion constructor/linux/construct.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CNApy
version: 1.0.7
version: 1.0.8

ignore_duplicate_files: True

Expand Down
4 changes: 2 additions & 2 deletions constructor/win/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ We use conda as package manager to install CNApy. You can use [miniconda](https:

1. Create a conda environment with all dependencies
```sh
conda create -n cnapy-1.0.7 -c conda-forge -c cnapy cnapy=1.0.7
conda create -n cnapy-1.0.8 -c conda-forge -c cnapy cnapy=1.0.8
```

2. Activate the cnapy conda environment
```
conda activate cnapy-1.0.7
conda activate cnapy-1.0.8
```

3. Run CNApy
Expand Down
4 changes: 2 additions & 2 deletions constructor/win/construct.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CNApy
version: 1.0.7
version: 1.0.8

ignore_duplicate_files: True

Expand All @@ -10,7 +10,7 @@ channels:

specs:
- conda
# - cnapy=1.0.7
# - cnapy=1.0.8
- mamba
- pip
- python=3.8
Expand Down
2 changes: 1 addition & 1 deletion constructor/win/post_install.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
call %~dp0..\Scripts\activate.bat

call mamba install cnapy=1.0.7 -c cnapy -c conda-forge -v --yes
call mamba install cnapy=1.0.8 -c cnapy -c conda-forge -v --yes
call pause
call %~dp0..\Scripts\conda clean --all --yes
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ dependencies:
- psutil=5.9
- efmtool_link=0.0.4
- optlang_enumerator=0.0.7
- straindesign=1.2
- straindesign=1.3
- gurobi
- cplex
2 changes: 1 addition & 1 deletion recipes/linux/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = '1.0.7' %}
{% set version = '1.0.8' %}

package:
name: cnapy
Expand Down
2 changes: 1 addition & 1 deletion recipes/noarch/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = '1.0.7' %}
{% set version = '1.0.8' %}

package:
name: cnapy
Expand Down
2 changes: 1 addition & 1 deletion recipes/win/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = '1.0.7' %}
{% set version = '1.0.8' %}

package:
name: cnapy
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='cnapy',
version='1.0.7',
version='1.0.8',
url='https://github.com/cnapy-org/CNApy/',
license='GPLv3+',
description='An integrated environment for metabolic network analysis.',
Expand Down

0 comments on commit ffd4def

Please sign in to comment.