Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting path construction #197

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/acom_music_box/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This package contains modules for handling various aspects of a music box,
including species, products, reactants, reactions, and more.
"""
__version__ = "2.2.1"
__version__ = "2.2.2"

from .utils import convert_time, convert_pressure, convert_temperature, convert_concentration
from .species import Species
Expand Down
10 changes: 5 additions & 5 deletions src/acom_music_box/evolving_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ def from_config_JSON(
if 'evolving conditions' in config_JSON:
if len(config_JSON['evolving conditions'].keys()) > 0:
# Construct the path to the evolving conditions file
evolving_conditions_path = (
os.path.dirname(path_to_json) +
"/" +
list(
config_JSON['evolving conditions'].keys())[0])

evolving_conditions_path = os.path.join(
os.path.dirname(path_to_json),
list(config_JSON['evolving conditions'].keys())[0])

evolving_conditions = EvolvingConditions.read_conditions_from_file(
evolving_conditions_path, species_list, reaction_list)

Expand Down
3 changes: 2 additions & 1 deletion src/acom_music_box/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def main():

# create and load a MusicBox object
myBox = MusicBox()
logging.info("configuration file = {}".format(musicBoxConfigFile))
myBox.readConditionsFromJson(musicBoxConfigFile)
logger.info("myBox = {}".format(myBox))

Expand All @@ -87,7 +88,7 @@ def main():
myBox.create_solver(campConfig)
logger.info("myBox.solver = {}".format(myBox.solver))
mySolution = myBox.solve(os.path.join(musicBoxOutputDir, "mySolution.csv"))
logger.info("mySolution = {}".format(mySolution))
# logger.info("mySolution = {}".format(mySolution))

logger.info("End time: {}".format(datetime.datetime.now()))
sys.exit(0)
Expand Down
5 changes: 3 additions & 2 deletions src/acom_music_box/reaction_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def from_config_JSON(cls, path_to_json, config_JSON, species_list):
list_name = None

# gets config file path
config_file_path = os.path.dirname(
path_to_json) + "/" + config_JSON['model components'][0]['configuration file']
config_file_path = os.path.join(
os.path.dirname(path_to_json),
config_JSON['model components'][0]['configuration file'])

# opnens config path to read reaction file
with open(config_file_path, 'r') as json_file:
Expand Down